Skip to content

Instantly share code, notes, and snippets.

@cannorin cannorin/hungry.metaml
Last active Dec 16, 2015

Embed
What would you like to do?
// 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
You can’t perform that action at this time.