I recently learned what the heck "currying" means. I'm sure I'm not the only one who struggled to grasp what this term means, since its name does not come from an intuitive notion of the concept, but rather it is named after Haskell Curry who first explored this approach.<p>A curried function allows an incomplete argument list, in which case it returns a new function that is still awaiting the missing arguments. This allows you to compose (combine) functions into new, reusable functions. A powerful tool for programmers, and yet unfortunately we give it a name that often reminds us of curry the food and nothing else.<p>Can we stop calling it "currying" then and instead call it something meaningful? How about Argument-Deferred Functional Composition, or my preferred shorthand: argument deferral.<p>Obviously, the name "currying" and "curried function" is widespread, so it would be appropriate to say argument deferral (i.e., currying) or argument-deferred function (i.e., curried function).<p>Am I right to have a pet peeve about this, or should stop programming and go into marketing?
Why call them 'arguments' when nobody is arguing?<p>Currying is the name of the thing. Adding another Enterprise Edition Operational Process Development Pattern like "argument deferral" isn't any better. I mean "Dependency Injection" isn't any easier for beginners to grasp, even though that is what it is.<p>Besides, it isn't argument deferral. That could easily be confused with evaluation order or things like lazy/normal/strict evaluation.
"Call 'it' something 'meaningful'"?? "Currying" is meaningful...<p>Perhaps 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?<p>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.
I've read any number of peeves against certain forms of language use, and don't agree that that necessarily pigeonholes someone into marketing.<p>Lisp, for example, uses 'car' and 'cdr' because of the hardware registers of the IBM 704. Some prefer 'first' and 'rest', but compact composed versions like '(cadr x)' for (car (cdr x)) don't exist for those English variants.<p>"to curry" as a verb has advantages over your preferred term of "argument deferral", if only because I can write:<p><pre><code> def curry(f, *curry_args):
def curried(*args):
return f(curry_args + args)
curried.__name__ = "curried_" + f.__name
return curried
</code></pre>
using a one word function name instead of "argument_deferral". (I've also seen 'xapply' in Python code, as in <a href="http://bytecodehacks.sourceforge.net/bch-docs/bch/module-bytecodehacks.xapply.html" rel="nofollow">http://bytecodehacks.sourceforge.net/bch-docs/bch/module-byt...</a> ).<p>It also has the inverse 'uncurry', mentioned in <a href="https://downloads.haskell.org/~ghc/6.12.2/docs/html/libraries/base-4.2.0.1/Data-Tuple.html#v%3Auncurry" rel="nofollow">https://downloads.haskell.org/~ghc/6.12.2/docs/html/librarie...</a> .<p>Your version would be "undefer the argument deferred function", I believe, vs. "uncurry the curried function". Not only is it longer, but I see a possible ambiguity: "undefer" might mean to actually call it.<p>In general though, there is a lot of specialized vocabulary. "A trampoline is a loop that iteratively invokes thunk-returning functions". "I used an AVL tree in the hidden Markov model." I don't see how the big problem is the inability to understand the concept from lexical decomposition of the term.
Another name for currying is "partial application". See <a href="http://en.m.wikipedia.org/wiki/Partial_application" rel="nofollow">http://en.m.wikipedia.org/wiki/Partial_application</a>
You're right, it should be called Schönfinkeling <a href="http://en.wikipedia.org/wiki/Moses_Sch%C3%B6nfinkel" rel="nofollow">http://en.wikipedia.org/wiki/Moses_Sch%C3%B6nfinkel</a>
To answer your question, I don't think it matters what it's called, just that you learn what it means (just like any word).<p>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.
Sometimes you do not want an understandable name for a thing... instead a merely memorable one is far better.<p>Currying is actually an incredibly specific and universal thing. It's the act of noting that a function space<p><pre><code> (a, b) -> c
</code></pre>
is the same as a "higher-order function space"<p><pre><code> a -> (b -> c)
</code></pre>
in a very particular way. It's <i>worth it</i> to give this thing it's own name because it's a highly important and unique transformation.<p>"Curring" and partial application as it exists which take this notion further, such as those which transform (a, b, c) -> d to (a -> b -> c -> d) or (a, b, c) -> d to ((a, c) -> b -> d) are generalizations of the core concept and perhaps don't honestly deserve the name (if you're a stickler).<p>Merely calling currying and uncurrying by some operational name de-emphasizes these operations. It's like calling a "home run" a "quadruple" in baseball. Sure, it makes sense, but it's really just missing something.
I don't recall currying -- either the name or the concept -- being a particular stumbling-block for beginners trying to learn functional programming.<p>There isn't really a problem that needs solving here.
Thanks everyone for the comments. It is interesting to see how widely "currying" is conflated with "partial application". I have to say, I still find the name to be a stumbling block. Perhaps this discussion can help to reverse that trend.<p>I have also learned a good deal more from these comments and further research. It seems my idea of "currying" was not entirely complete. Per the comment herein: "Currying turns polyadic function into a sequence of unary functions". Practically speaking, this means a curried function is a single-input function that will return a function which is still awaiting an argument, so that other functions can be added to the "currying chain".<p>I would call this "function sequencing". This term could be equally intuitive for functional languages (ML / Haskell) and non-functional languages alike. However, I think that non-functional language users will still appreciate an explanation that references "argument deferral", since this is one of the practical benefits, and is also the key part of the "functional" context-switch needed to understand the concept (i.e., you can compose functions without providing the arguments/inputs).<p>Is there an equivalent to "uncurrying"? (un-what-ing??) This verbiage sounds like we're trying to unpluck a chicken. On Wikipedia (the world's collective brain dump), we understand uncurrying to be "the dual transformation to currying, and can be seen as a form of defunctionalization." Crystal. I'll losely interpret this as flattening the unary (single-input) function sequence into one polyadic (multi-input) function. So can we refer to this as "function bundling"?<p>To summarize, I'm submitting "sequencing" and "bundling" as the two simple verbs that better describe "currying" and "uncurrying".
Completely agree. It is atypical in any progamming language to have names of functions/operators that do not bear some relation with the nature of the function/operation.<p>While your suggestion suffers from a lack of concision, the point remains: A single word replacement that approximates the nature of what "currying" does, would be helpful.