Last active
December 16, 2015 16:34
-
-
Save cannorin/989a9ae2d019f36c63fc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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