Created
February 14, 2013 13:44
-
-
Save AlexMost/4952895 to your computer and use it in GitHub Desktop.
error_monad
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
OK = undefined | |
error_m = -> | |
is_error = ([err, val]) -> err isnt OK | |
result: (v) -> [OK, v] | |
bind: (mv, f) -> | |
if (is_error mv) then mv else (f mv[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment