Skip to content

Instantly share code, notes, and snippets.

@owainlewis
Created July 19, 2012 08:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save owainlewis/3141531 to your computer and use it in GitHub Desktop.
Save owainlewis/3141531 to your computer and use it in GitHub Desktop.
Partial Function Application
(defn add [a b] (+ a b))
(def addTwo (partial add 2))
(addTwo 5)
(map addTwo [1 2 3])
# Partial Functions
from functools import partial
def add(a, b):
return a + b
def addTwo = partial(add, 2)
addTwo(5)
# Mapping partial functions
# Ruby partial
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment