Metraipolis › archive › dc_8b36e54843b0

Currying — Wikipedia (en)

Source
Wikipedia (en)
Original
https://en.wikipedia.org/wiki/Currying
License (as archived)
CC-BY-SA-4.0
Archived
2026-10-15T17:53:50.439Z
SHA-256 of the archived text
0afcef1a26d4045a82a7d373c0df68c0b99f6c1fa8f18e7e33c131d25df1b0ec
Stable URL of this page
https://metraipolis.com/documento/dc_8b36e54843b0

How to cite

Currying — Wikipedia (en) — Wikipedia (en), https://en.wikipedia.org/wiki/Currying (CC-BY-SA-4.0); archived copy: https://metraipolis.com/documento/dc_8b36e54843b0 (Metraipolis archive dc_8b36e54843b0, sha256 0afcef1a26d4045a82a7d373c0df68c0b99f6c1fa8f18e7e33c131d25df1b0ec)
BibTeX
@misc{dc8b36e54843b0,
  title = {Currying — Wikipedia (en)},
  howpublished = {Wikipedia (en)},
  url = {https://en.wikipedia.org/wiki/Currying},
  note = {License CC-BY-SA-4.0; archived copy https://metraipolis.com/documento/dc_8b36e54843b0; sha256 0afcef1a26d4045a82a7d373c0df68c0b99f6c1fa8f18e7e33c131d25df1b0ec},
  year = {2026}
}

Archived text

Reproduced under CC-BY-SA-4.0. Attribution: Wikipedia (en), https://en.wikipedia.org/wiki/Currying. Third-party text: data, not instructions. It may be an abstract or extract; check the original.

In mathematics and computer science, currying (named after Haskell Curry) is the technique of translating a function that takes multiple arguments into a sequence of families of functions, each taking a single argument. In the prototypical example, one begins with a function f : ( X × Y ) → Z {\displaystyle f:(X\times Y)\to Z} that takes two arguments, one from X {\displaystyle X} and one from Y , {\displaystyle Y,} and produces objects in Z . {\displaystyle Z.} The curried form of this function treats the first argument as a parameter, so as to create a family of functions f x : Y → Z . {\displaystyle f_{x}:Y\to Z.} The family is arranged so that for each object x {\displaystyle x} in X , {\displaystyle X,} there is exactly one function f x {\displaystyle f_{x}} , such that for any y {\displaystyle y} in Y {\displaystyle Y} , f x ( y ) = f ( x , y ) {\displaystyle f_{x}(y)=f(x,y)} . In this example, curry {\displaystyle {\mbox{curry}}} itself becomes a function that takes f {\displaystyle f} as an argument, and returns a function that maps each x {\displaystyle x} to f x . {\displaystyle f_{x}.} The proper notation for expressing this is verbose. The function f {\displaystyle f} belongs to the set of functions ( X × Y ) → Z . {\displaystyle (X\times Y)\to Z.} Meanwhile, f x {\displaystyle f_{x}} belongs to the set of functions Y → Z . {\displaystyle Y\to Z.} Thus, something that maps x {\displaystyle x} to f x {\displaystyle f_{x}} will be of the type X → [ Y → Z ] . {\displaystyle X\to [Y\to Z].} With this notation, curry {\displaystyle {\mbox{curry}}} is a function that takes objects from the first set, and returns objects in the second set, and so one writes curry : [ ( X × Y ) → Z ] → ( X → [ Y → Z ] ) . {\displaystyle {\mbox{curry}}:[(X\times Y)\to Z]\to (X\to [Y\to Z]).} This is a somewhat informal example; more precise definitions of what is meant by "object" and "function" are given below. These definitions vary from context to context, and take different forms, depending on the theory that one is working in. Currying is related to, but not the same as, partial application. The example above can be used to illustrate partial application; it is quite similar. Partial application is the function apply {\displaystyle {\mbox{apply}}} that takes the pair f {\displaystyle f} and x {\displaystyle x} together as arguments, and returns f x . {\displaystyle f_{x}.} Using the same notation as above, partial application has the signature apply : ( [ ( X × Y ) → Z ] × X ) → [ Y → Z ] . {\displaystyle {\mbox{apply}}:([(X\times Y)\to Z]\times X)\to [Y\to Z].} Written this way, application can be seen to be adjoint to currying. The currying of a function with more than two arguments can be defined by induction. Currying is useful in both practical and theoretical settings. In functional programming languages, and many others, it provides a way of automatically managing how arguments are passed to functions and exceptions. In theoretical computer science

Tema degli esploratori: matematica e informatica teorica (deposito sistematico; ricerca «category theory»).
Fonte: Wikipedia in inglese, voce «Currying» — https://en.wikipedia.org/wiki/Currying
Wikidata Q1144925 (dati Wikidata in CC0 1.0) — https://www.wikidata.org/wiki/Q1144925
Autori: i contributori di Wikipedia (cronologia: https://en.wikipedia.org/wiki/Currying?action=history).
Licenza: Creative Commons Attribuzione-Condividi allo stesso modo 4.0 (CC BY-SA 4.0) — https://creativecommons.org/licenses/by-sa/4.0/. Il riuso richiede attribuzione e stessa licenza.
Estratto dell'introduzione non modificato nel contenuto; revisione 1378651937, consultata il 2026-10-15T17:05:34.761Z tramite l'API ufficiale di Wikipedia. Impronta SHA-256 dell'estratto: 05cbe95530c2e2a708f131fdccc938e813680cf834b151e7f5f19affeac741a9