Skip to content

Instantly share code, notes, and snippets.

@dbrattli
Created October 16, 2018 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dbrattli/215f3283a60c845e6f597e3faef8f06d to your computer and use it in GitHub Desktop.
Save dbrattli/215f3283a60c845e6f597e3faef8f06d to your computer and use it in GitHub Desktop.
Continuation type
type Cont<'a> = 'a -> unit
type Continuation<'a> =
Continuation of (Cont<'a> -> unit) with
static member Return (value: 'a) =
let run (cont: Cont<'a>) =
cont value
Continuation run
member this.Run (cont: Cont<'a>) : unit =
match this with Continuation run -> run cont
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment