Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Currying
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
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!
=== Lambda calculi === In [[theoretical computer science]], currying provides a way to study functions with multiple arguments in very simple theoretical models, such as the [[lambda calculus]], in which functions only take a single argument. Consider a function <math>f(x,y)</math> taking two arguments, and having the type <math>(X \times Y)\to Z</math>, which should be understood to mean that ''x'' must have the type <math>X</math>, ''y'' must have the type <math>Y</math>, and the function itself returns the type <math>Z</math>. The curried form of ''f'' is defined as :<math>\text{curry}(f) = \lambda x.(\lambda y.(f(x,y)))</math> where <math>\lambda</math> is the abstractor of lambda calculus. Since curry takes, as input, functions with the type <math>(X\times Y)\to Z</math>, one concludes that the type of curry itself is :<math>\text{curry}:((X \times Y)\to Z) \to (X \to (Y \to Z))</math> The β operator is often considered [[right-associative]], so the curried function type <math>X \to (Y \to Z)</math> is often written as <math>X \to Y \to Z</math>. Conversely, [[function application]] is considered to be [[Operator associativity|left-associative]], so that <math>f(x, y)</math> is equivalent to :<math>((\text{curry}(f) \; x) \;y) = \text{curry}(f) \; x \;y</math>. That is, the parenthesis are not required to disambiguate the order of the application. Curried functions may be used in any [[programming language]] that supports [[closure (computer science)|closure]]s; however, uncurried functions are generally preferred for efficiency reasons, since the overhead of partial application and closure creation can then be avoided for most function calls.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Currying
(section)
Add topic