Skip to content

Instantly share code, notes, and snippets.

@ericmoritz
Created April 25, 2014 19:07
Show Gist options
  • Select an option

  • Save ericmoritz/11299822 to your computer and use it in GitHub Desktop.

Select an option

Save ericmoritz/11299822 to your computer and use it in GitHub Desktop.
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