Created
November 9, 2017 19:11
-
-
Save Leonidas-from-XIV/370144f05cb9020fa0aff7de93085359 to your computer and use it in GitHub Desktop.
Peano arithmetics in Continuation Passing Style
This file contains hidden or 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
let const v k = | |
k v | |
let inc k v = | |
k (v + 1) | |
let print v = | |
Printf.printf "Value %d\n" v | |
let () = | |
const 0 @@ print | |
let () = | |
const 0 @@ inc @@ inc @@ inc @@ inc @@ print |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment