Skip to content

Commit 3b76f44

Browse files
scratchpad WIP
1 parent c0a0a76 commit 3b76f44

File tree

3 files changed

+45
-21
lines changed

3 files changed

+45
-21
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
open System.IO
3+
4+
let releaseNotesfile =
5+
[| __SOURCE_DIRECTORY__; "..\..\.."; "RELEASE_NOTES.md" |]
6+
|> Path.Combine
7+
|> Path.GetFullPath
8+
9+
let release xs =
10+
let isStart(s: string) = s.StartsWith("####")
11+
12+
match xs with
13+
| h :: t when isStart h ->
14+
let current = t |> List.takeWhile (not << isStart)
15+
let upcoming = t |> List.skipWhile (not << isStart)
16+
Some(h::current, upcoming)
17+
| _ -> None
18+
19+
let splitUpByRelease =
20+
releaseNotesfile
21+
|> File.ReadAllLines
22+
|> Array.toList
23+
|> Array.unfold release
24+
25+
let reversed = splitUpByRelease |> Array.rev |> Array.collect Array.ofList
26+
27+
28+
File.WriteAllLines(releaseNotesfile, reversed)
29+
Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,23 @@
11

2-
open System.IO
2+
open System
33

4-
let releaseNotesfile =
5-
[| __SOURCE_DIRECTORY__; "..\..\.."; "RELEASE_NOTES.md" |]
6-
|> Path.Combine
7-
|> Path.GetFullPath
4+
type Date(dt: DateTime) =
5+
member this.Year = dt.Year
6+
member this.Month = dt.Month
7+
member this.Day = dt.Day
88

9-
let release xs =
10-
let isStart(s: string) = s.StartsWith("####")
9+
static member op_Implicit(x: DateTime) : Date = Date(x)
10+
static member op_Implicit(x: Date) : DateTime = DateTime(x.Year, x.Month, x.Day)
1111

12-
match xs with
13-
| h :: t when isStart h ->
14-
let current = t |> List.takeWhile (not << isStart)
15-
let upcoming = t |> List.skipWhile (not << isStart)
16-
Some(h::current, upcoming)
17-
| _ -> None
12+
let now = DateTime.Now
1813

19-
let splitUpByRelease =
20-
releaseNotesfile
21-
|> File.ReadAllLines
22-
|> Array.toList
23-
|> Array.unfold release
14+
let inline implicit arg =
15+
( ^a : (static member op_Implicit : ^b -> ^a) arg)
2416

25-
let reversed = splitUpByRelease |> Array.rev |> Array.collect Array.ofList
26-
17+
Convert.ToDateTime(Date(now))
2718

28-
File.WriteAllLines(releaseNotesfile, reversed)
19+
now |> box :> Date
20+
21+
//Convert.ChangeType(Nullable 42, typeof<int>)
22+
Convert.ChangeType(42M, typeof<float>)
2923

src/SqlClient/SqlClient.fsproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
<Compile Include="SqlClientProvider.fs" />
8686
<Compile Include="SqlEnumProvider.fs" />
8787
<None Include="Scripts\Scratchpad.fsx" />
88+
<None Include="Scripts\ReverseLineOrderForNotex.fsx" />
8889
<None Include="Scripts\XE.fsx" />
8990
<None Include="packages.config" />
9091
</ItemGroup>

0 commit comments

Comments
 (0)