This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from https://ayende.com/blog/164865/what-about-f-collections | |
open System | |
open System.Diagnostics | |
let ayende iterations = | |
let sp = Stopwatch.StartNew () | |
let rnd = Random 32 | |
let mutable dic = Map.empty |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System | |
open System.Diagnostics | |
open System | |
let getNextSequential n = | |
let r = Random 42 | |
let start = r.Next (n*3/2) | |
fun i -> (start + i) % n | |
let getNextRandom n = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System | |
open System.Diagnostics | |
let getNextRandom () = | |
let r = Random () | |
let rec getNext m = | |
match r.Next () with | |
| n when m |> Map.containsKey n -> getNext m | |
| n -> n | |
getNext |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System | |
open System.Drawing | |
open System.Diagnostics | |
let colours = [ | |
"Transparent", Color.Transparent | |
"AliceBlue", Color.AliceBlue | |
"AntiqueWhite", Color.AntiqueWhite | |
"Aqua", Color.Aqua | |
"Aquamarine", Color.Aquamarine |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System | |
type KeyStruct(_1':int, _2':int, _3':int) = struct | |
member this._1 = _1' | |
member this._2 = _2' | |
member this._3 = _3' | |
end | |
type KeyGenericStruct<'a>(_1':'a, _2':'a, _3':'a) = struct | |
member this._1 = _1' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type KeyStruct(_1':int, _2':int, _3':int) = struct | |
member this._1 = _1' | |
member this._2 = _2' | |
member this._3 = _3' | |
end | |
type KeyGenericStruct<'a>(_1':'a, _2':'a, _3':'a) = struct | |
member this._1 = _1' | |
member this._2 = _2' | |
member this._3 = _3' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Program | |
open Perf | |
open System | |
open System.Diagnostics | |
module Tortoise = | |
let test () = | |
let today = DateTime.Now | |
let tomorrow = today.AddDays 1.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Program | |
open Perf | |
open System | |
open System.Diagnostics | |
[<EntryPoint>] | |
let main argv = | |
printfn "%s" Id.Name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Program | |
open Perf | |
open System | |
open System.Diagnostics | |
open System.Collections.Generic | |
type StructureInt = | |
struct |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open Perf | |
type EnumA = A0 = 0 | A1 = 1 | A2 = 2 | A3 = 3 | A4 = 4 | A5 = 5 | A6 = 0x7 | |
let getAnEnum i = match i &&& 7 with 0 -> EnumA.A0 | 1 -> EnumA.A1 | 2 -> EnumA.A2 | 3 -> EnumA.A3 | 4 -> EnumA.A4 | 5 -> EnumA.A5 | _ -> EnumA.A6 | |
type R = { | |
GroupByKey : EnumA | |
OtherData : float | |
} |