Created
August 23, 2018 03:21
-
-
Save LeifW/779a0825e501d43b95062d5804738082 to your computer and use it in GitHub Desktop.
Do-notation desugaring in Idris
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
-- Apply the callback that is the rest of the lines of code | |
(>>=) : Int -> (Int -> Int) -> Int | |
(>>=) x f = f x | |
i : Int | |
i = do | |
x <- 1 | |
y <- 2 | |
x + y | |
-- Or with effect syntax. | |
j : Int | |
j = !1 + 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
General version of that
>>=
is:(which is just
flip apply
)