Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Currying
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Motivation== Currying provides a way for working with functions that take multiple arguments, and using them in frameworks where functions might take only one argument. For example, some [[#Definition|analytical techniques]] can only be applied to [[function (mathematics)|function]]s with a single argument. Practical functions frequently take more arguments than this. [[Gottlob Frege|Frege]] showed that it was sufficient to provide solutions for the single argument case, as it was possible to transform a function with multiple arguments into a chain of single-argument functions instead. This transformation is the process now known as currying.<ref>{{cite web |author= |date=November 2002 |editor-last=Hutton |editor-first=Graham |editor2-last=Jones |editor2-first=Mark P. |title=Frequently Asked Questions for comp.lang.functional, 3. Technical topics, 3.2. Currying |url=http://www.cs.nott.ac.uk/~gmh/faq.html#currying |url-status= |archive-url= |archive-date= |work=University of Nottingham Computer Science}}</ref> All "ordinary" functions that might typically be encountered in [[mathematical analysis]] or in [[computer programming]] can be curried. However, there are categories in which currying is not possible; the most general categories which allow currying are the [[closed monoidal category|closed monoidal categories]]. Some [[programming language]]s almost always use curried functions to achieve multiple arguments; notable examples are [[ML (programming language)|ML]] and [[Haskell]], where in both cases all functions have exactly one argument. This property is inherited from [[lambda calculus]], where multi-argument functions are usually represented in curried form. Currying is related to, but not the same as [[partial application]].<ref name="lambda-the-ultimate"/><ref name="uncarved"/> In practice, the programming technique of [[Closure (computer programming)|closures]] can be used to perform partial application and a kind of currying, by hiding arguments in an environment that travels with the curried function.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)