PlanetMath (more info)
 Math for the people, by the people.
Encyclopedia | Requests | Forums | Docs | Wiki | Random | RSS  
Login
create new user
name:
pass:
forget your password?
Main Menu
Owner confidence rating: High Entry average rating: No information on entry rating
currying (Definition)

Currying is the technique of emulating multiple-parametered functions with higher-order functions. The notion is that a function of $ n$ arguments can be thought of as a function of 1 argument that maps to a function of $ n-1$ arguments. A curried function is a function represented by currying, e.g.

$\displaystyle f \colon A \to (B\to C) $

For conciseness, the mapping operator $ \rightarrow$ is usually considered right-associative, so one could drop the parentheses in the expression above and write $ f \colon A\to B\to C$ instead.

In contrast, an uncurried function is usually specified as a mapping from a Cartesian product, such as

$\displaystyle f \colon (A\times B)\to C. $

The term currying is derived from the name of Haskell Curry, a 20th-century logician. However, Curry was not the first person to discover this notion, as it was first introduced by Gottlob Frege in 1893 and expanded by Moses Schönfinkel in the 1920s. Hence the notion is sometimes referred to as schönfinkeling.

From the perspective of category theory, currying can be thought of as exploiting the fact that $ -\times B$ and $ {\mathrm{Hom}}(B,-)$ are adjoint functors on $ \mathbf{Set}$. That is, for each set $ B$, there is a natural equivalence

$\displaystyle \nu\colon {\mathrm{Hom}}_{\mathbf{Set}}(-\times B,-)\overset{\cdot}{\longrightarrow}{\mathrm{Hom}}_{\mathbf{Set}}(-,{\mathrm{Hom}}(B,-)) $
defined by sending a map $ f\colon (A\times B)\to C$ to the map $ \nu_f\colon A\to {\mathrm{Hom}}(B, C)$. For each $ a\in A$, $ \nu_f(a)\colon B\to C$ is the map defined by $ \nu_f(a)(b) = f(a,b)$.



Anyone with an account can edit this entry. Please help improve it!

"currying" is owned by mps. [ full author list (2) | owner history (1) ]
(view preamble)

View style:

See Also: higher-order function

Other names:  schönfinkeling, schönfinkelization
Also defines:  curried function, uncurried function

Attachments:
explicit form for currying (Derivation) by rspuzio
Log in to rate this entry.
(view current ratings)

Cross-references: equivalence, natural equivalence, adjoint functors, category theory, expanded, Haskell, Cartesian product, expression, operator, mapping, maps, arguments, higher-order functions, functions
There is 1 reference to this entry.

This is version 5 of currying, born on 2002-03-29, modified 2007-05-25.
Object id is 2806, canonical name is Currying.
Accessed 6925 times total.

Classification:
AMS MSC68Q01 (Computer science :: Theory of computing :: General)

Pending Errata and Addenda
None.
[ View all 2 ]
Discussion
Style: Expand: Order:
forum policy

No messages.

Interact
post | correct | update request | add derivation | add example | add (any)