Skip to content

Instantly share code, notes, and snippets.

@mame
Forked from taku0/shift_reset_call_cc.txt
Last active March 14, 2016 15:50
Show Gist options
  • Save mame/297b5f2f725cc30c1c92 to your computer and use it in GitHub Desktop.
Save mame/297b5f2f725cc30c1c92 to your computer and use it in GitHub Desktop.
M1 k1 = (call/cc (M2 k1)) + 3
M2 k1 k2 = if b then (k1 1) else (k2 2)
(call/cc M1) + 4
S1 k1 = (shift (λk2. k2 (S2 k1 k2))) + 3
S2 k1 k2 = if b then (k1 1) else (k2 2)
reset(exit(shift (λk1. k1 (S1 k1)) + 4))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment