Skip to content

Instantly share code, notes, and snippets.

@dbrattli
Last active October 7, 2018 19:46
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/1f48ad6d4fb3ae0bcea6fb7f764344c5 to your computer and use it in GitHub Desktop.
Save dbrattli/1f48ad6d4fb3ae0bcea6fb7f764344c5 to your computer and use it in GitHub Desktop.
Times 10 Curried Continuation
// Return a function that takes a callback that takes the result.
let times10 (x: int) : ((int -> unit) -> unit) =
let thenDo (cb : int -> unit) =
cb (x * 10)
thenDo
let cb result =
printfn "%A" result
let thenDo = times10 42
do thenDo(cb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment