# currying

*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.

$$f:A\to (B\to C)$$ |

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

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

$$f:(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 $\mathrm{\mathbf{S}\mathbf{e}\mathbf{t}}$. That is, for each set $B$, there is a natural
equivalence

$$\nu :{\mathrm{Hom}}_{\mathrm{\mathbf{S}\mathbf{e}\mathbf{t}}}(-\times B,-)\stackrel{\cdot}{\u27f6}{\mathrm{Hom}}_{\mathrm{\mathbf{S}\mathbf{e}\mathbf{t}}}(-,\mathrm{Hom}(B,-))$$ |

defined by sending a map $f:(A\times B)\to C$ to the map ${\nu}_{f}:A\to \mathrm{Hom}(B,C)$. For each $a\in A$, ${\nu}_{f}(a):B\to C$ is the map defined by ${\nu}_{f}(a)(b)=f(a,b)$.

Title | currying |
---|---|

Canonical name | Currying |

Date of creation | 2013-03-22 12:33:35 |

Last modified on | 2013-03-22 12:33:35 |

Owner | mps (409) |

Last modified by | mps (409) |

Numerical id | 8 |

Author | mps (409) |

Entry type | Definition |

Classification | msc 68Q01 |

Synonym | schönfinkeling |

Synonym | schönfinkelization |

Related topic | HigherOrderFunction |

Defines | curried function |

Defines | uncurried function |