Skip to content

Instantly share code, notes, and snippets.

@mattbierner
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattbierner/9727402 to your computer and use it in GitHub Desktop.
Save mattbierner/9727402 to your computer and use it in GitHub Desktop.
Akh DCont example
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);
}
@mattbierner
Copy link
Author

ouput: [[11, 21], [12, 22]]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment