articles filed under javascript
Partial application and currying
posted on 12/04/07 at 12:33 p.m. |
|
Currying, known in Python land as partial application, is a technique in which a function taking multiple arguments composes a function that takes fewer arguments (in most languages, reducing to one, although this is not the case in Python) by partially applying it to given parameters. For example, a function, sum, might be used to compose a new function called "plus_one" by currying it with the value of one. The composed function is not evaluated; it is returned as a function object which may then be applied to other parameters.