TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Can we stop calling it currying?

14 pointsby jonlachlanabout 10 years ago
I recently learned what the heck &quot;currying&quot; means. I&#x27;m sure I&#x27;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 &quot;currying&quot; then and instead call it something meaningful? How about Argument-Deferred Functional Composition, or my preferred shorthand: argument deferral.<p>Obviously, the name &quot;currying&quot; and &quot;curried function&quot; 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?

15 comments

Retraabout 10 years ago
Why call them &#x27;arguments&#x27; when nobody is arguing?<p>Currying is the name of the thing. Adding another Enterprise Edition Operational Process Development Pattern like &quot;argument deferral&quot; isn&#x27;t any better. I mean &quot;Dependency Injection&quot; isn&#x27;t any easier for beginners to grasp, even though that is what it is.<p>Besides, it isn&#x27;t argument deferral. That could easily be confused with evaluation order or things like lazy&#x2F;normal&#x2F;strict evaluation.
评论 #9245155 未加载
评论 #9254023 未加载
aguerar1about 10 years ago
&quot;Call &#x27;it&#x27; something &#x27;meaningful&#x27;&quot;?? &quot;Currying&quot; is meaningful...<p>Perhaps you just aren&#x27;t comfortable with the idea that its meaning wasn&#x27;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 &quot;verbificiation&quot; of a noun (sometimes even a proper one). In this case, Haskell Curry was &quot;verbified&quot;, and so now we have &quot;currying&quot;. I don&#x27;t care to speculate as to why &quot;currying&quot; was favored over &quot;some-compounding-of-words-that-you-think-precisely-conveys-the-exact-meaning&quot;, but I assure you the first person to use &quot;currying&quot;, 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&#x27;s any good, it&#x27;ll catch on.
dalkeabout 10 years ago
I&#x27;ve read any number of peeves against certain forms of language use, and don&#x27;t agree that that necessarily pigeonholes someone into marketing.<p>Lisp, for example, uses &#x27;car&#x27; and &#x27;cdr&#x27; because of the hardware registers of the IBM 704. Some prefer &#x27;first&#x27; and &#x27;rest&#x27;, but compact composed versions like &#x27;(cadr x)&#x27; for (car (cdr x)) don&#x27;t exist for those English variants.<p>&quot;to curry&quot; as a verb has advantages over your preferred term of &quot;argument deferral&quot;, if only because I can write:<p><pre><code> def curry(f, *curry_args): def curried(*args): return f(curry_args + args) curried.__name__ = &quot;curried_&quot; + f.__name return curried </code></pre> using a one word function name instead of &quot;argument_deferral&quot;. (I&#x27;ve also seen &#x27;xapply&#x27; in Python code, as in <a href="http://bytecodehacks.sourceforge.net/bch-docs/bch/module-bytecodehacks.xapply.html" rel="nofollow">http:&#x2F;&#x2F;bytecodehacks.sourceforge.net&#x2F;bch-docs&#x2F;bch&#x2F;module-byt...</a> ).<p>It also has the inverse &#x27;uncurry&#x27;, 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:&#x2F;&#x2F;downloads.haskell.org&#x2F;~ghc&#x2F;6.12.2&#x2F;docs&#x2F;html&#x2F;librarie...</a> .<p>Your version would be &quot;undefer the argument deferred function&quot;, I believe, vs. &quot;uncurry the curried function&quot;. Not only is it longer, but I see a possible ambiguity: &quot;undefer&quot; might mean to actually call it.<p>In general though, there is a lot of specialized vocabulary. &quot;A trampoline is a loop that iteratively invokes thunk-returning functions&quot;. &quot;I used an AVL tree in the hidden Markov model.&quot; I don&#x27;t see how the big problem is the inability to understand the concept from lexical decomposition of the term.
评论 #9252491 未加载
AmbientLionabout 10 years ago
Another name for currying is &quot;partial application&quot;. See <a href="http://en.m.wikipedia.org/wiki/Partial_application" rel="nofollow">http:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Partial_application</a>
评论 #9245340 未加载
评论 #9245296 未加载
评论 #9245243 未加载
gclaramuntabout 10 years ago
You&#x27;re right, it should be called Schönfinkeling <a href="http://en.wikipedia.org/wiki/Moses_Sch%C3%B6nfinkel" rel="nofollow">http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Moses_Sch%C3%B6nfinkel</a>
muaddiracabout 10 years ago
To answer your question, I don&#x27;t think it matters what it&#x27;s called, just that you learn what it means (just like any word).<p>As an aside, what you&#x27;re describing isn&#x27;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.
评论 #9254011 未加载
评论 #9245471 未加载
telabout 10 years ago
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&#x27;s the act of noting that a function space<p><pre><code> (a, b) -&gt; c </code></pre> is the same as a &quot;higher-order function space&quot;<p><pre><code> a -&gt; (b -&gt; c) </code></pre> in a very particular way. It&#x27;s <i>worth it</i> to give this thing it&#x27;s own name because it&#x27;s a highly important and unique transformation.<p>&quot;Curring&quot; and partial application as it exists which take this notion further, such as those which transform (a, b, c) -&gt; d to (a -&gt; b -&gt; c -&gt; d) or (a, b, c) -&gt; d to ((a, c) -&gt; b -&gt; d) are generalizations of the core concept and perhaps don&#x27;t honestly deserve the name (if you&#x27;re a stickler).<p>Merely calling currying and uncurrying by some operational name de-emphasizes these operations. It&#x27;s like calling a &quot;home run&quot; a &quot;quadruple&quot; in baseball. Sure, it makes sense, but it&#x27;s really just missing something.
评论 #9254434 未加载
avoidworkabout 10 years ago
the name isn&#x27;t the difficult part, so changing it will not make it easier for people to grok.
johan_larsonabout 10 years ago
I don&#x27;t recall currying -- either the name or the concept -- being a particular stumbling-block for beginners trying to learn functional programming.<p>There isn&#x27;t really a problem that needs solving here.
评论 #9245866 未加载
评论 #9249241 未加载
评论 #9245133 未加载
steven2012about 10 years ago
Can &quot;we&quot; stop using the term because &quot;I&quot; don&#x27;t like it?
jonlachlanabout 10 years ago
Thanks everyone for the comments. It is interesting to see how widely &quot;currying&quot; is conflated with &quot;partial application&quot;. 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 &quot;currying&quot; was not entirely complete. Per the comment herein: &quot;Currying turns polyadic function into a sequence of unary functions&quot;. 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 &quot;currying chain&quot;.<p>I would call this &quot;function sequencing&quot;. This term could be equally intuitive for functional languages (ML &#x2F; Haskell) and non-functional languages alike. However, I think that non-functional language users will still appreciate an explanation that references &quot;argument deferral&quot;, since this is one of the practical benefits, and is also the key part of the &quot;functional&quot; context-switch needed to understand the concept (i.e., you can compose functions without providing the arguments&#x2F;inputs).<p>Is there an equivalent to &quot;uncurrying&quot;? (un-what-ing??) This verbiage sounds like we&#x27;re trying to unpluck a chicken. On Wikipedia (the world&#x27;s collective brain dump), we understand uncurrying to be &quot;the dual transformation to currying, and can be seen as a form of defunctionalization.&quot; Crystal. I&#x27;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 &quot;function bundling&quot;?<p>To summarize, I&#x27;m submitting &quot;sequencing&quot; and &quot;bundling&quot; as the two simple verbs that better describe &quot;currying&quot; and &quot;uncurrying&quot;.
评论 #9254048 未加载
评论 #9253878 未加载
tomcamabout 10 years ago
A little surprised by the resistance to your suggestion. Apparently I too am doomed to retire into marketing after 30 years of programming.
chrisbrandowabout 10 years ago
Completely agree. It is atypical in any progamming language to have names of functions&#x2F;operators that do not bear some relation with the nature of the function&#x2F;operation.<p>While your suggestion suffers from a lack of concision, the point remains: A single word replacement that approximates the nature of what &quot;currying&quot; does, would be helpful.
评论 #9253859 未加载
yogthosabout 10 years ago
That&#x27;s why Clojure calls it &quot;partial&quot; to indicate you&#x27;re doing partial application <a href="http://conj.io/store/v0/org.clojure/clojure/1.7.0-alpha4/clj/clojure.core/partial/" rel="nofollow">http:&#x2F;&#x2F;conj.io&#x2F;store&#x2F;v0&#x2F;org.clojure&#x2F;clojure&#x2F;1.7.0-alpha4&#x2F;clj...</a>
评论 #9254038 未加载
评论 #9248243 未加载
评论 #9254036 未加载
malandrewabout 10 years ago
Schönfinkelisation is my preferred alternative.