I hereby claim:
- I am eiriktsarpalis on github.
- I am eiriktsarpalis (https://keybase.io/eiriktsarpalis) on keybase.
- I have a public key ASDsjo4ajiE7h4qGM_HbGrq2lco-Kj5LfRn2uCjZ2axtIQo
To claim this, I am signing this object:
| let run x = Async.RunSynchronously x | |
| let runParallel (workflow : Async<'T>) = | |
| [| for i in 1 .. 100 -> workflow |] | |
| |> Async.Parallel | |
| |> run | |
| let a = async { return 42 } | |
| let b = async { return run (async { return 42 })} |
| type Cont<'T> = ('T -> unit) -> (exn -> unit) -> unit | |
| let ret t = fun sc _ -> sc t | |
| let (>>=) f g = | |
| fun sc ec -> | |
| let sc' (t : 'T) = | |
| match (try Choice1Of2 (g t) with e -> Choice2Of2 e) with | |
| | Choice1Of2 g -> g sc ec | |
| | Choice2Of2 e -> ec e |
| type Test = | |
| static member F<'T>(t : 'T option) = () | |
| static member F<'T>(e : 'T -> 'T) = () | |
| type Foo = { A : int } | |
| type Bar = { A : int } | |
| Test.F(fun (r:Foo) -> { r with A = 32 }) // type checks | |
| Test.F(fun (r:Bar) -> { r with A = 32 }) // type checks | |
| Test.F<Foo>(fun r -> { r with A = 32 }) // type error |
| open System | |
| open System.Reflection | |
| open Microsoft.FSharp.Quotations | |
| open Microsoft.FSharp.Quotations.Patterns | |
| open Microsoft.FSharp.Quotations.DerivedPatterns | |
| type MethodInfo with | |
| /// Gets the underlying method definition | |
| /// including the supplied declaring type and method type arguments |
| { | |
| "Success": { | |
| "_flags": "subtype", | |
| "subtype": { | |
| "Case": "GenericTypeInstance", | |
| "GenericDefinition": { | |
| "Case": "NamedType", | |
| "Name": "MBrace.Core.Builders+Bind@331-1", | |
| "Assembly": { | |
| "Name": "MBrace.Core", |
| open System | |
| open System.Runtime.CompilerServices | |
| type SymbolicException = | |
| { | |
| Source : Exception | |
| Stacktrace : string list | |
| } | |
| module SymbolicException = |
| module Client = | |
| let connectionString = Environment.GetEnvironmentVariable("CONN") | |
| let session = new Session(connectionString) | |
| let doA (a : A) = session.Send a | |
| let doB (b : B) = session.Send b | |
| type Client(connectionString : string) = |
| #time "on" | |
| open System | |
| open System.Collections.Generic | |
| let gdata = [|for i in 1 .. 1000000 -> Guid.NewGuid()|] | |
| let sdata = gdata |> Array.map string | |
| // Real: 00:00:17.774, CPU: 00:00:17.703, GC gen0: 378, gen1: 61, gen2: 1 | |
| let gmap = ref Map.empty<Guid, int> |
| // One of the common annoyances when writing imperative code in F# is that the | |
| // expression-based nature of the language makes it effectively impossible to | |
| // break or return in the midst of a for-loop. This is an attempt to encode | |
| // lightweight cancellation on top of native for loops. As usual, this is intended | |
| // as a PoC and should not be considered seriously for production code. | |
| module Seq = | |
| open System.Collections | |
| open System.Collections.Generic |
I hereby claim:
To claim this, I am signing this object: