Skip to content

Instantly share code, notes, and snippets.

View manofstick's full-sized avatar

Paul Westcott manofstick

  • Kaiser Trading Group
  • Melbourne, Australia
View GitHub Profile
// 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
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 =
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
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
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'
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'
module Program
open Perf
open System
open System.Diagnostics
module Tortoise =
let test () =
let today = DateTime.Now
let tomorrow = today.AddDays 1.0
module Program
open Perf
open System
open System.Diagnostics
[<EntryPoint>]
let main argv =
printfn "%s" Id.Name
module Program
open Perf
open System
open System.Diagnostics
open System.Collections.Generic
type StructureInt =
struct
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
}