2 ms·
Another name for currying is "partial application". See http://en.m.wikipedia.org/wiki/Partial_application http://en.m.wikipedia.org/wiki/Partial_application
by AmbientLion 12y ago
Another name for currying is "partial application". See http://en.m.wikipedia.org/wiki/Partial_application http://en.m.wikipedia.org/wiki/Partial_application
- deleted 12y ago[deleted]
- the_cat_kittles 12y agonot quite the same thing- currying turns polyadic function into a sequence of unary functions, whereas partial application gives you a function with a couple arguments filled already
- eutectic 12y agoThis a common misconception. Partial application is like taking f(x, y) = x + y and turning it into f(y) = 1 + y by supplying x = 1. Currying is like taking the same function and turning it into (f(x))(y) = x + y. Expressing f as a higher-order single argument function in this way gives us the advantages of partial application using normal total application. A good example is the derivative function from calculus, which could be specified in at least two obvious ways. A simple, but ugly solution is to have it take a function and a point as arguments and return the value of the derivative at that point. Alternatively, it could take a function and return its derivative as a function, which could then be evaluated at many different points. This is the difference between e.g. (Float -> Float, Float) -> Float, and (Float -> Float) -> (Float -> Float). Taking this idea to its logical conclusion and applying it to any multiple argument function gives you currying.