Last active
August 29, 2015 13:57
-
-
Save mattbierner/9727402 to your computer and use it in GitHub Desktop.
Akh DCont example
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
with | |
import 'akh::base' {liftM2}, | |
import 'akh::dcont' {runDCont of shift reset} | |
in { | |
var list = liftM2 @ \x y -> [x, y]; | |
runDCont( | |
reset \ p -> | |
liftM2((+), | |
shift @ p \k -> | |
list(k (of 1), k (of 2)), | |
shift @ p \k -> | |
list(k (of 10), k (of 20))), | |
\x -> x); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ouput: [[11, 21], [12, 22]]