Skip to content

Instantly share code, notes, and snippets.

@cannorin
Last active December 16, 2015 16:34
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 cannorin/989a9ae2d019f36c63fc to your computer and use it in GitHub Desktop.
Save cannorin/989a9ae2d019f36c63fc to your computer and use it in GitHub Desktop.
// type <T> ... code of T
//
// <~<t>> -> <t>
// run <t> -> t
let hungry i =
let rec f i =
match i with
| 0 -> < () >
| x -> < (fun _ -> ~(f(i - 1)) ) >
in f i
// hungry : int -> <unit>
let h3 = hungry 3
// h3 : <'a -> 'b -> 'c -> unit>
(run h3) 1 2 3
// it : unit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment