Another name for currying is "partial application". See http://en.m.wikipedia.org/wiki/Partial_application
Can we stop calling it currying?
11–20 of 44 posts
Re: Can we stop calling it currying?
#12Re: Can we stop calling it currying?
#13Another name for currying is "partial application". See http://en.m.wikipedia.org/wiki/Partial_application
Re: Can we stop calling it currying?
#14Another name for currying is "partial application". See http://en.m.wikipedia.org/wiki/Partial_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.
Re: Can we stop calling it currying?
#15Perhaps you just aren't comfortable with the idea that its meaning wasn't formed via some sort of compounding pattern you thought would be more inherently meaningful(?), or maybe you feel the need for natural language to be as precise as your programs?
There are lots of different ways that new words come into a language, and one of them is "verbificiation" of a noun (sometimes even a proper one). In this case, Haskell Curry was "verbified", and so now we have "currying". I don't care to speculate as to why "currying" was favored over "some-compounding-of-words-that-you-think-precisely-conveys-the-exact-meaning", but I assure you the first person to use "currying", did it because they thought in that moment that that was the best way to meaningfully convey the idea they were talking about, and the others around that person (implicitly) agreed by using it too. If you really think you can do better, start calling it something else; if it's any good, it'll catch on.
Re: Can we stop calling it currying?
#16Re: Can we stop calling it currying?
#17To answer your question, I don't think it matters what it's called, just that you learn what it means (just like any word). As an aside, what you're describing isn't strictly currying. The key insight of currying is that a function of multiple arguments can be decomposed in to a series of function applications where each function takes only one argument - this is related to but not the same as partial application.
Re: Can we stop calling it currying?
#18I don't recall currying -- either the name or the concept -- being a particular stumbling-block for beginners trying to learn functional programming. There isn't really a problem that needs solving here.
Another name for this technique is "partial application".
Re: Can we stop calling it currying?
#19I don't recall currying -- either the name or the concept -- being a particular stumbling-block for beginners trying to learn functional programming. There isn't really a problem that needs solving here.
When first exposed to ML/Haskell code, they may use simple mental models such as "you write function arguments without parens and commas" and "the last type in foo -> bar -> baz is the return type". Then it gets replaced with realization that "oh, so 'let f x y = x + y' is just a sugar for 'let f = fun x -> fun y -> x + y'".
If one is learning the concept in a language that supports functions of multiple arguments and uses something else than currying for built-in partial application mechanism, I can imagine them having problems with it. Learning how familiar things works internally is usually easier than learning "this is what you can do and why you may want it".