Skip to content

Instantly share code, notes, and snippets.

@nsfyn55
Created June 7, 2015 15:51
Show Gist options
  • Save nsfyn55/8749b340e6136f192069 to your computer and use it in GitHub Desktop.
Save nsfyn55/8749b340e6136f192069 to your computer and use it in GitHub Desktop.
Currying Example
def add(x, y):
return x + y
def add_curried(x):
def partial(y):
return x + y
return partial
print add(3,4)
# full application
print add_curried(3)(4)
# partial application
add_one = add_curried(1)
print add_one(2)
print add_one(3)
print add_one(4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment