<s>
In	O
mathematics	O
and	O
computer	B-General_Concept
science	I-General_Concept
,	O
currying	B-Application
is	O
the	O
technique	O
of	O
translating	O
the	O
evaluation	O
of	O
a	O
function	O
that	O
takes	O
multiple	O
arguments	O
into	O
evaluating	O
a	O
sequence	O
of	O
functions	O
,	O
each	O
with	O
a	O
single	O
argument	O
.	O
</s>
<s>
In	O
a	O
more	O
mathematical	O
language	O
,	O
a	O
function	O
that	O
takes	O
two	O
arguments	O
,	O
one	O
from	O
and	O
one	O
from	O
,	O
and	O
produces	O
outputs	O
in	O
by	O
currying	B-Application
is	O
translated	O
into	O
a	O
function	O
that	O
takes	O
a	O
single	O
argument	O
from	O
and	O
produces	O
as	O
outputs	O
functions	O
from	O
to	O
This	O
is	O
a	O
natural	O
one-to-one	B-Algorithm
correspondence	I-Algorithm
between	O
these	O
two	O
types	O
of	O
functions	O
,	O
so	O
that	O
the	O
sets	O
together	O
with	O
functions	O
between	O
them	O
form	O
a	O
Cartesian	B-Application
closed	I-Application
category	I-Application
.	O
</s>
<s>
The	O
currying	B-Application
of	O
a	O
function	O
with	O
more	O
than	O
two	O
arguments	O
can	O
then	O
be	O
defined	O
by	O
induction	O
.	O
</s>
<s>
Currying	B-Application
is	O
related	O
to	O
,	O
but	O
not	O
the	O
same	O
as	O
,	O
partial	B-Application
application	I-Application
.	O
</s>
<s>
Currying	B-Application
is	O
useful	O
in	O
both	O
practical	O
and	O
theoretical	O
settings	O
.	O
</s>
<s>
In	O
functional	B-Language
programming	I-Language
languages	I-Language
,	O
and	O
many	O
others	O
,	O
it	O
provides	O
a	O
way	O
of	O
automatically	O
managing	O
how	O
arguments	O
are	O
passed	O
to	O
functions	O
and	O
exceptions	O
.	O
</s>
<s>
In	O
theoretical	O
computer	B-General_Concept
science	I-General_Concept
,	O
it	O
provides	O
a	O
way	O
to	O
study	O
functions	O
with	O
multiple	O
arguments	O
in	O
simpler	O
theoretical	O
models	O
which	O
provide	O
only	O
one	O
argument	O
.	O
</s>
<s>
The	O
most	O
general	O
setting	O
for	O
the	O
strict	O
notion	O
of	O
currying	B-Application
and	O
uncurrying	B-Application
is	O
in	O
the	O
closed	O
monoidal	O
categories	O
,	O
which	O
underpins	O
a	O
vast	O
generalization	O
of	O
the	O
Curry	B-Application
–	O
Howard	O
correspondence	O
of	O
proofs	O
and	O
programs	O
to	O
a	O
correspondence	O
with	O
many	O
other	O
structures	O
,	O
including	O
quantum	O
mechanics	O
,	O
cobordisms	O
and	O
string	O
theory	O
.	O
</s>
<s>
and	O
further	O
developed	O
by	O
Haskell	B-Language
Curry	B-Application
.	O
</s>
<s>
Uncurrying	B-Application
is	O
the	O
dual	O
transformation	O
to	O
currying	B-Application
,	O
and	O
can	O
be	O
seen	O
as	O
a	O
form	O
of	O
defunctionalization	B-Application
.	O
</s>
<s>
Currying	B-Application
provides	O
a	O
way	O
for	O
working	O
with	O
functions	O
that	O
take	O
multiple	O
arguments	O
,	O
and	O
using	O
them	O
in	O
frameworks	O
where	O
functions	O
might	O
take	O
only	O
one	O
argument	O
.	O
</s>
<s>
This	O
transformation	O
is	O
the	O
process	O
now	O
known	O
as	O
currying	B-Application
.	O
</s>
<s>
All	O
"	O
ordinary	O
"	O
functions	O
that	O
might	O
typically	O
be	O
encountered	O
in	O
mathematical	O
analysis	O
or	O
in	O
computer	B-General_Concept
programming	I-General_Concept
can	O
be	O
curried	B-Application
.	O
</s>
<s>
However	O
,	O
there	O
are	O
categories	O
in	O
which	O
currying	B-Application
is	O
not	O
possible	O
;	O
the	O
most	O
general	O
categories	O
which	O
allow	O
currying	B-Application
are	O
the	O
closed	O
monoidal	O
categories	O
.	O
</s>
<s>
Some	O
programming	O
languages	O
almost	O
always	O
use	O
curried	B-Application
functions	I-Application
to	O
achieve	O
multiple	O
arguments	O
;	O
notable	O
examples	O
are	O
ML	B-Language
and	O
Haskell	B-Language
,	O
where	O
in	O
both	O
cases	O
all	O
functions	O
have	O
exactly	O
one	O
argument	O
.	O
</s>
<s>
This	O
property	O
is	O
inherited	O
from	O
lambda	B-Language
calculus	I-Language
,	O
where	O
multi-argument	O
functions	O
are	O
usually	O
represented	O
in	O
curried	B-Application
form	I-Application
.	O
</s>
<s>
Currying	B-Application
is	O
related	O
to	O
,	O
but	O
not	O
the	O
same	O
as	O
partial	B-Application
application	I-Application
.	O
</s>
<s>
In	O
practice	O
,	O
the	O
programming	O
technique	O
of	O
closures	B-Language
can	O
be	O
used	O
to	O
perform	O
partial	B-Application
application	I-Application
and	O
a	O
kind	O
of	O
currying	B-Application
,	O
by	O
hiding	O
arguments	O
in	O
an	O
environment	O
that	O
travels	O
with	O
the	O
curried	B-Application
function	I-Application
.	O
</s>
<s>
Currying	B-Application
translates	O
this	O
into	O
a	O
function	O
which	O
takes	O
a	O
single	O
real	O
argument	O
and	O
outputs	O
functions	O
from	O
to	O
.	O
</s>
<s>
so	O
that	O
the	O
original	O
function	O
and	O
its	O
currying	B-Application
convey	O
exactly	O
the	O
same	O
information	O
.	O
</s>
<s>
The	O
"	O
Curry	B-Application
"	O
in	O
"	O
Currying	B-Application
"	O
is	O
a	O
reference	O
to	O
logician	O
Haskell	B-Language
Curry	B-Application
,	O
who	O
used	O
the	O
concept	O
extensively	O
,	O
but	O
Moses	O
Schönfinkel	O
had	O
the	O
idea	O
six	O
years	O
before	O
Curry	B-Application
.	O
</s>
<s>
The	O
alternative	O
name	O
"	O
Schönfinkelisation	B-Application
"	O
has	O
been	O
proposed	O
.	O
</s>
<s>
The	O
originator	O
of	O
the	O
word	O
"	O
currying	B-Application
"	O
is	O
not	O
clear	O
.	O
</s>
<s>
David	O
Turner	O
says	O
the	O
word	O
was	O
coined	O
by	O
Christopher	O
Strachey	O
in	O
his	O
1967	O
lecture	O
notes	O
Fundamental	O
Concepts	O
in	O
Programming	O
Languages	O
,	O
but	O
although	O
the	O
concept	O
is	O
mentioned	O
,	O
the	O
word	O
"	O
currying	B-Application
"	O
does	O
not	O
appear	O
in	O
the	O
notes	O
.	O
</s>
<s>
John	O
C	O
.	O
Reynolds	O
defined	O
"	O
currying	B-Application
"	O
in	O
a	O
1972	O
paper	O
,	O
but	O
did	O
not	O
claim	O
to	O
have	O
coined	O
the	O
term	O
.	O
</s>
<s>
Currying	B-Application
is	O
most	O
easily	O
understood	O
by	O
starting	O
with	O
an	O
informal	O
definition	O
,	O
which	O
can	O
then	O
be	O
molded	O
to	O
fit	O
many	O
different	O
domains	O
.	O
</s>
<s>
Currying	B-Application
is	O
the	O
natural	O
bijection	B-Algorithm
between	O
the	O
set	O
of	O
functions	O
from	O
to	O
,	O
and	O
the	O
set	O
of	O
functions	O
from	O
to	O
the	O
set	O
of	O
functions	O
from	O
to	O
.	O
</s>
<s>
Indeed	O
,	O
it	O
is	O
this	O
natural	O
bijection	B-Algorithm
that	O
justifies	O
the	O
exponential	O
notation	O
for	O
the	O
set	O
of	O
functions	O
.	O
</s>
<s>
As	O
is	O
the	O
case	O
in	O
all	O
instances	O
of	O
currying	B-Application
,	O
the	O
formula	O
above	O
describes	O
an	O
adjoint	O
pair	O
of	O
functors	O
:	O
for	O
every	O
fixed	O
set	O
,	O
the	O
functor	O
is	O
left	O
adjoint	O
to	O
the	O
functor	O
.	O
</s>
<s>
In	O
the	O
theory	O
of	O
function	B-Algorithm
spaces	I-Algorithm
,	O
such	O
as	O
in	O
functional	B-Application
analysis	I-Application
or	O
homotopy	O
theory	O
,	O
one	O
is	O
commonly	O
interested	O
in	O
continuous	O
functions	O
between	O
topological	O
spaces	O
.	O
</s>
<s>
while	O
uncurrying	B-Application
is	O
the	O
inverse	O
map	O
.	O
</s>
<s>
One	O
useful	O
corollary	O
is	O
that	O
a	O
function	O
is	O
continuous	O
if	O
and	O
only	O
if	O
its	O
curried	B-Application
form	I-Application
is	O
continuous	O
.	O
</s>
<s>
Another	O
important	O
result	O
is	O
that	O
the	O
application	O
map	O
,	O
usually	O
called	O
"	O
evaluation	O
"	O
in	O
this	O
context	O
,	O
is	O
continuous	O
(	O
note	O
that	O
eval	O
is	O
a	O
strictly	O
different	O
concept	O
in	O
computer	B-General_Concept
science	I-General_Concept
.	O
)	O
</s>
<s>
is	O
continuous	O
when	O
is	O
compact-open	B-Algorithm
and	O
locally	O
compact	O
Hausdorff	O
.	O
</s>
<s>
In	O
algebraic	O
topology	O
,	O
currying	B-Application
serves	O
as	O
an	O
example	O
of	O
Eckmann	O
–	O
Hilton	O
duality	O
,	O
and	O
,	O
as	O
such	O
,	O
plays	O
an	O
important	O
role	O
in	O
a	O
variety	O
of	O
different	O
settings	O
.	O
</s>
<s>
The	O
curried	B-Application
form	I-Application
then	O
maps	O
the	O
space	O
to	O
the	O
space	B-Algorithm
of	I-Algorithm
functions	I-Algorithm
from	O
loops	O
into	O
,	O
that	O
is	O
,	O
from	O
into	O
.	O
</s>
<s>
Then	O
is	O
the	O
adjoint	O
functor	O
that	O
maps	O
suspensions	O
to	O
loop	O
spaces	O
,	O
and	O
uncurrying	B-Application
is	O
the	O
dual	O
.	O
</s>
<s>
The	O
duality	O
between	O
the	O
mapping	O
cone	O
and	O
the	O
mapping	O
fiber	O
(	O
cofibration	O
and	O
fibration	O
)	O
can	O
be	O
understood	O
as	O
a	O
form	O
of	O
currying	B-Application
,	O
which	O
in	O
turn	O
leads	O
to	O
the	O
duality	O
of	O
the	O
long	O
exact	O
and	O
coexact	O
Puppe	O
sequences	O
.	O
</s>
<s>
In	O
homological	O
algebra	O
,	O
the	O
relationship	O
between	O
currying	B-Application
and	O
uncurrying	B-Application
is	O
known	O
as	O
tensor-hom	O
adjunction	O
.	O
</s>
<s>
Scott-continuous	O
functions	O
were	O
first	O
investigated	O
in	O
the	O
attempt	O
to	O
provide	O
a	O
semantics	O
for	O
lambda	B-Language
calculus	I-Language
(	O
as	O
ordinary	O
set	O
theory	O
is	O
inadequate	O
to	O
do	O
this	O
)	O
.	O
</s>
<s>
More	O
generally	O
,	O
Scott-continuous	O
functions	O
are	O
now	O
studied	O
in	O
domain	O
theory	O
,	O
which	O
encompasses	O
the	O
study	O
of	O
denotational	B-Application
semantics	I-Application
of	O
computer	O
algorithms	O
.	O
</s>
<s>
In	O
theoretical	O
computer	B-General_Concept
science	I-General_Concept
,	O
currying	B-Application
provides	O
a	O
way	O
to	O
study	O
functions	O
with	O
multiple	O
arguments	O
in	O
very	O
simple	O
theoretical	O
models	O
,	O
such	O
as	O
the	O
lambda	B-Language
calculus	I-Language
,	O
in	O
which	O
functions	O
only	O
take	O
a	O
single	O
argument	O
.	O
</s>
<s>
where	O
is	O
the	O
abstractor	O
of	O
lambda	B-Language
calculus	I-Language
.	O
</s>
<s>
The	O
→	O
operator	O
is	O
often	O
considered	O
right-associative	O
,	O
so	O
the	O
curried	B-Application
function	I-Application
type	O
is	O
often	O
written	O
as	O
.	O
</s>
<s>
Curried	B-Application
functions	I-Application
may	O
be	O
used	O
in	O
any	O
programming	O
language	O
that	O
supports	O
closures	B-Language
;	O
however	O
,	O
uncurried	O
functions	O
are	O
generally	O
preferred	O
for	O
efficiency	O
reasons	O
,	O
since	O
the	O
overhead	O
of	O
partial	B-Application
application	I-Application
and	O
closure	B-Language
creation	O
can	O
then	O
be	O
avoided	O
for	O
most	O
function	O
calls	O
.	O
</s>
<s>
In	O
type	O
theory	O
,	O
the	O
general	O
idea	O
of	O
a	O
type	O
system	O
in	O
computer	B-General_Concept
science	I-General_Concept
is	O
formalized	O
into	O
a	O
specific	O
algebra	O
of	O
types	O
.	O
</s>
<s>
The	O
type-theoretical	O
approach	O
is	O
expressed	O
in	O
programming	O
languages	O
such	O
as	O
ML	B-Language
and	O
the	O
languages	O
derived	O
from	O
and	O
inspired	O
by	O
it	O
:	O
CaML	B-Language
,	O
Haskell	B-Language
and	O
F#	B-Operating_System
.	O
</s>
<s>
This	O
is	O
because	O
categories	O
,	O
and	O
specifically	O
,	O
monoidal	O
categories	O
,	O
have	O
an	O
internal	O
language	O
,	O
with	O
simply-typed	O
lambda	B-Language
calculus	I-Language
being	O
the	O
most	O
prominent	O
example	O
of	O
such	O
a	O
language	O
.	O
</s>
<s>
Currying	B-Application
then	O
endows	O
the	O
language	O
with	O
a	O
natural	O
product	O
type	O
.	O
</s>
<s>
The	O
correspondence	O
between	O
objects	O
in	O
categories	O
and	O
types	O
then	O
allows	O
programming	O
languages	O
to	O
be	O
re-interpreted	O
as	O
logics	O
(	O
via	O
Curry	B-Application
–	O
Howard	O
correspondence	O
)	O
,	O
and	O
as	O
other	O
types	O
of	O
mathematical	O
systems	O
,	O
as	O
explored	O
further	O
,	O
below	O
.	O
</s>
<s>
Under	O
the	O
Curry	B-Application
–	O
Howard	O
correspondence	O
,	O
the	O
existence	O
of	O
currying	B-Application
and	O
uncurrying	B-Application
is	O
equivalent	O
to	O
the	O
logical	O
theorem	O
,	O
as	O
tuples	B-Application
(	O
product	O
type	O
)	O
corresponds	O
to	O
conjunction	O
in	O
logic	O
,	O
and	O
function	O
type	O
corresponds	O
to	O
implication	O
.	O
</s>
<s>
The	O
above	O
notions	O
of	O
currying	B-Application
and	O
uncurrying	B-Application
find	O
their	O
most	O
general	O
,	O
abstract	O
statement	O
in	O
category	O
theory	O
.	O
</s>
<s>
Currying	B-Application
is	O
a	O
universal	O
property	O
of	O
an	O
exponential	O
object	O
,	O
and	O
gives	O
rise	O
to	O
an	O
adjunction	O
in	O
cartesian	B-Application
closed	I-Application
categories	I-Application
.	O
</s>
<s>
This	O
generalizes	O
to	O
a	O
broader	O
result	O
in	O
closed	O
monoidal	O
categories	O
:	O
Currying	B-Application
is	O
the	O
statement	O
that	O
the	O
tensor	O
product	O
and	O
the	O
internal	O
Hom	O
are	O
adjoint	O
functors	O
;	O
that	O
is	O
,	O
for	O
every	O
object	O
there	O
is	O
a	O
natural	O
isomorphism	O
:	O
</s>
<s>
Currying	B-Application
can	O
break	O
down	O
in	O
one	O
of	O
two	O
ways	O
.	O
</s>
<s>
The	O
setting	O
of	O
cartesian	B-Application
closed	I-Application
categories	I-Application
is	O
sufficient	O
for	O
the	O
discussion	O
of	O
classical	O
logic	O
;	O
the	O
more	O
general	O
setting	O
of	O
closed	O
monoidal	O
categories	O
is	O
suitable	O
for	O
quantum	B-Architecture
computation	I-Architecture
.	O
</s>
<s>
Simply	O
typed	O
lambda	B-Language
calculus	I-Language
is	O
the	O
internal	O
language	O
of	O
cartesian	B-Application
closed	I-Application
categories	I-Application
;	O
and	O
it	O
is	O
for	O
this	O
reason	O
that	O
pairs	O
and	O
lists	O
are	O
the	O
primary	O
types	O
in	O
the	O
type	O
theory	O
of	O
LISP	B-Language
,	O
Scheme	B-Language
and	O
many	O
functional	B-Language
programming	I-Language
languages	I-Language
.	O
</s>
<s>
By	O
contrast	O
,	O
the	O
product	O
for	O
monoidal	O
categories	O
(	O
such	O
as	O
Hilbert	O
space	O
and	O
the	O
vector	O
spaces	O
of	O
functional	B-Application
analysis	I-Application
)	O
is	O
the	O
tensor	O
product	O
.	O
</s>
<s>
Such	O
categories	O
are	O
suitable	O
for	O
describing	O
entangled	O
quantum	O
states	O
,	O
and	O
,	O
more	O
generally	O
,	O
allow	O
a	O
vast	O
generalization	O
of	O
the	O
Curry	B-Application
–	O
Howard	O
correspondence	O
to	O
quantum	O
mechanics	O
,	O
to	O
cobordisms	O
in	O
algebraic	O
topology	O
,	O
and	O
to	O
string	O
theory	O
.	O
</s>
<s>
Currying	B-Application
and	O
partial	B-Application
function	I-Application
application	I-Application
are	O
often	O
conflated	O
.	O
</s>
<s>
One	O
of	O
the	O
significant	O
differences	O
between	O
the	O
two	O
is	O
that	O
a	O
call	O
to	O
a	O
partially	O
applied	O
function	O
returns	O
the	O
result	O
right	O
away	O
,	O
not	O
another	O
function	O
down	O
the	O
currying	B-Application
chain	O
;	O
this	O
distinction	O
can	O
be	O
illustrated	O
clearly	O
for	O
functions	O
whose	O
arity	O
is	O
greater	O
than	O
two	O
.	O
</s>
<s>
Given	O
a	O
function	O
of	O
type	O
,	O
currying	B-Application
produces	O
.	O
</s>
<s>
That	O
is	O
,	O
while	O
an	O
evaluation	O
of	O
the	O
first	O
function	O
might	O
be	O
represented	O
as	O
,	O
evaluation	O
of	O
the	O
curried	B-Application
function	I-Application
would	O
be	O
represented	O
as	O
,	O
applying	O
each	O
argument	O
in	O
turn	O
to	O
a	O
single-argument	O
function	O
returned	O
by	O
the	O
previous	O
invocation	O
.	O
</s>
<s>
In	O
contrast	O
,	O
partial	B-Application
function	I-Application
application	I-Application
refers	O
to	O
the	O
process	O
of	O
fixing	O
a	O
number	O
of	O
arguments	O
to	O
a	O
function	O
,	O
producing	O
another	O
function	O
of	O
smaller	O
arity	O
.	O
</s>
<s>
Note	O
that	O
the	O
result	O
of	O
partial	B-Application
function	I-Application
application	I-Application
in	O
this	O
case	O
is	O
a	O
function	O
that	O
takes	O
two	O
arguments	O
.	O
</s>
<s>
Intuitively	O
,	O
partial	B-Application
function	I-Application
application	I-Application
says	O
"	O
if	O
you	O
fix	O
the	O
first	O
argument	O
of	O
the	O
function	O
,	O
you	O
get	O
a	O
function	O
of	O
the	O
remaining	O
arguments	O
"	O
.	O
</s>
<s>
The	O
practical	O
motivation	O
for	O
partial	B-Application
application	I-Application
is	O
that	O
very	O
often	O
the	O
functions	O
obtained	O
by	O
supplying	O
some	O
but	O
not	O
all	O
of	O
the	O
arguments	O
to	O
a	O
function	O
are	O
useful	O
;	O
for	O
example	O
,	O
many	O
languages	O
have	O
a	O
function	O
or	O
operator	O
similar	O
to	O
plus_one	O
.	O
</s>
<s>
Partial	B-Application
application	I-Application
makes	O
it	O
easy	O
to	O
define	O
these	O
functions	O
,	O
for	O
example	O
by	O
creating	O
a	O
function	O
that	O
represents	O
the	O
addition	O
operator	O
with	O
1	O
bound	O
as	O
its	O
first	O
argument	O
.	O
</s>
<s>
Partial	B-Application
application	I-Application
can	O
be	O
seen	O
as	O
evaluating	O
a	O
curried	B-Application
function	I-Application
at	O
a	O
fixed	O
point	O
,	O
e.g.	O
</s>
<s>
given	O
and	O
then	O
or	O
simply	O
where	O
curries	B-Application
f	O
's	O
first	O
parameter	O
.	O
</s>
<s>
Thus	O
,	O
partial	B-Application
application	I-Application
is	O
reduced	O
to	O
a	O
curried	B-Application
function	I-Application
at	O
a	O
fixed	O
point	O
.	O
</s>
<s>
Further	O
,	O
a	O
curried	B-Application
function	I-Application
at	O
a	O
fixed	O
point	O
is	O
(	O
trivially	O
)	O
,	O
a	O
partial	B-Application
application	I-Application
.	O
</s>
<s>
Thus	O
,	O
any	O
partial	B-Application
application	I-Application
may	O
be	O
reduced	O
to	O
a	O
single	O
curry	B-Application
operation	O
.	O
</s>
<s>
As	O
such	O
,	O
curry	B-Application
is	O
more	O
suitably	O
defined	O
as	O
an	O
operation	O
which	O
,	O
in	O
many	O
theoretical	O
cases	O
,	O
is	O
often	O
applied	O
recursively	O
,	O
but	O
which	O
is	O
theoretically	O
indistinguishable	O
(	O
when	O
considered	O
as	O
an	O
operation	O
)	O
from	O
a	O
partial	B-Application
application	I-Application
.	O
</s>
<s>
So	O
,	O
a	O
partial	B-Application
application	I-Application
can	O
be	O
defined	O
as	O
the	O
objective	O
result	O
of	O
a	O
single	O
application	O
of	O
the	O
curry	B-Application
operator	O
on	O
some	O
ordering	O
of	O
the	O
inputs	O
of	O
some	O
function	O
.	O
</s>
