Created
April 25, 2014 19:07
-
-
Save ericmoritz/11299822 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
| def bind(val, f): | |
| if val is None: | |
| return None | |
| else: | |
| return f(val) | |
| def maybeAdd(x, y): | |
| return bind( | |
| x, | |
| lambda x: bind( | |
| y, | |
| lambda y: x + y | |
| ) | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment