Created
August 30, 2015 23:39
-
-
Save TheSeamau5/5cd3271ace64176bc43d to your computer and use it in GitHub Desktop.
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
type alias Continuation a r = (a -> r) -> r | |
andThen : Continuation a r -> (a -> Continuation b r) -> Continuation b r | |
andThen cont f br = | |
cont (flip f br) | |
constant : a -> Continuation a r | |
constant a f = f a | |
test : Continuation Float a | |
test = | |
constant 4 | |
`andThen` \x -> constant (5 * x) | |
`andThen` \y -> constant (y / 6) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment