Last active
March 8, 2019 14:50
-
-
Save awto/3d1f19bd8d9fd26e164fb4829158338c to your computer and use it in GitHub Desktop.
continuation monad with suspense
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
const runCont = run( | |
value => cont => cont(value), | |
(arg, next) => cont => arg(value => next(value)(cont))); | |
const useState = initial => | |
M(cont => | |
cont([initial, function next(value) { cont([value,next]); }])); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment