Curry[f,n]
represents an operator form of the function f of n arguments so that Curry[f,n][x1]…[xn] is equivalent to f[x1,…,xn].
Curry[f]
represents an operator form of the function f of two arguments so that Curry[f][y][x] is equivalent to f[x,y].
Curry[f,{i1,…,in}]
represents an operator form of the function f of n arguments so that Curry[f,{i1,…,in}][x1]…[xn] is equivalent to f[xi1,…,xin].
Curry[f,k{i1,…,in}]
represents a k-arguments operator form of the function f of n arguments so that Curry[f,k{i1,…,in}][x1]…[xk] is equivalent to f[xi1,…,xin], with k≥Max[{i1,…,in}].
Curry
Curry[f,n]
represents an operator form of the function f of n arguments so that Curry[f,n][x1]…[xn] is equivalent to f[x1,…,xn].
Curry[f]
represents an operator form of the function f of two arguments so that Curry[f][y][x] is equivalent to f[x,y].
Curry[f,{i1,…,in}]
represents an operator form of the function f of n arguments so that Curry[f,{i1,…,in}][x1]…[xn] is equivalent to f[xi1,…,xin].
Curry[f,k{i1,…,in}]
represents a k-arguments operator form of the function f of n arguments so that Curry[f,k{i1,…,in}][x1]…[xk] is equivalent to f[xi1,…,xin], with k≥Max[{i1,…,in}].
Details
- Curry[f] is equivalent to Curry[f,{2,1}].
- Curry[f,n] is equivalent to Curry[f,{1,2,…,n}].
- Curry[f,{i1,…,in}] is equivalent to Curry[f,Max[{i1,…,in}]->{i1,…,in}].
- Curry[f,{i1,…,in,opts}][x1]…[xk] is equivalent to f[xi1,…,xin,opts] for a sequence opts of options.
- The ip
curried argument of Curry[f,{i1,…,in}] will be the p
argument of f. - Curry[f,arity][x1,…][y1,…]…[z1,…] is equivalent to Curry[f,arity][x1,…,y1,…,z1,…], so that the structure of brackets is not relevant, only the number of arguments.
Examples
open all close allBasic Examples (3)
Curry the second argument of a function of two arguments:
Curry[f][x][y]Curry a function of three arguments, keeping their order:
Curry[f, 3][x][y][z]This is a curried form of Integrate that curries two integration variables:
Curry[Integrate, {3, 1, 2}][x][y]Apply it to a function of variables
and
:
%[x Sin[y]]Integrate[x Sin[y], x, y]Scope (6)
Curry the second argument of a function:
Dx = Curry[D][x]Dx[f[x]]Curry a function of 3 arguments, keeping their order:
Curry[Nest, 3][f][x][4]Curry a function of 3 arguments, applying a permutation before they are passed to the function:
Curry[Nest, {3, 1, 2}][x][4][f]These are curried operators taking 4 arguments, but only 2 of them are passed to the function f:
Curry[f, {2, 4}][a][b][c][d]Curry[f, 4 -> {2, 3}][a][b][c][d]Use arguments of the curried operator with any bracketing structure:
op = Curry[f, 3]op[a][b][c]op[a, b, c]op[a, b][c]op[][a][][][b, c]Curry Level with default option values:
Sin[x[0] + 3]//Curry[Level][2]Pass options to Level:
Sin[x[0] + 3]//Curry[Level, {2, 1, Heads -> True}][2]Sin[x[0] + 3]//Curry[Level[##, Heads -> True]&][2]Applications (5)
Curry Composition of 3 functions:
Curry[Composition, 3]Feed the 3 functions sequentially:
%[f]%[g]%[h]Apply the composition to an expression:
Construct[%, x]Specify how many arguments are functions to be composed:
Curry[Composition, 3][f, g, h, x, y]Use Curry to construct the opposite order of a given ordering function:
oppositeAlphabeticOrder = Curry[AlphabeticOrder];{Order["a", "b"], oppositeAlphabeticOrder["a", "b"]}{Order["a", "a"], oppositeAlphabeticOrder["a", "a"]}Build an array of subscripted variables:
Array[Curry[Subscript, 4][x], {2, 3, 2}]Build the K and S combinators using Curry:
k = Curry[Identity, 2 -> {1}];
s = Curry[Function[#1[#3][#2[#3]]], 3];The combinations SKK and SKS are equivalent to the identity:
s[k][k][x]s[k][s][x]Build the B and C combinators using S and K:
b = s[k[s]][k];
c = s[s[k[s[k[s][k]]][s]][k[k]]];b[f][g][x]c[f][x][y]Properties & Relations (6)
Curry[f] is equivalent to Curry[f,{2,1}]:
Curry[f][a][b]Curry[f, {2, 1}][a][b]For a function of zero arguments, Curry[f,0] returns f[]:
Curry[f, 0]If additional arguments are provided, the empty pair of brackets is still inserted:
Curry[f, 0][a, b]Curry[Curry][3][f][a][b][c]Compare to Construct:
Construct[f, a, b, c]For positive n, Curry[Construct,n][f] is equivalent to Curry[f,n-1]:
Curry[Construct, 3][f][a][b][c]Curry[f, 2][a][b][c]The relation also holds for n=1:
Curry[Construct, 1][f]Curry[f, 0]Compose two Curry operators with a permutation and its inverse:
perm = {2, 4, 1, 3}
invperm = InversePermutation[perm]The result is equivalent to using Curry without reordering the arguments:
Curry[Curry[f, perm], invperm][a][b][c][d]Curry[f, 4][a][b][c][d]Take two permutation lists of the same length:
perm1 = {2, 4, 1, 3};
perm2 = {3, 2, 4, 1};Compose the corresponding Curry operators:
Curry[Curry[f, perm1], perm2][a][b][c][d]Alternatively, use Curry with their permutation product, in the same order:
Curry[f, PermutationProduct[perm1, perm2]][a, b, c, d]See Also
Construct Composition Function Slot Identity Apply Map
Function Repository: ApplyLevel Uncurry FlipFunction
History
Text
Wolfram Research (2018), Curry, Wolfram Language function, https://reference.wolfram.com/language/ref/Curry.html.
CMS
Wolfram Language. 2018. "Curry." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Curry.html.
APA
Wolfram Language. (2018). Curry. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Curry.html
BibTeX
@misc{reference.wolfram_2026_curry, author="Wolfram Research", title="{Curry}", year="2018", howpublished="\url{https://reference.wolfram.com/language/ref/Curry.html}", note=[Accessed: 15-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_curry, organization={Wolfram Research}, title={Curry}, year={2018}, url={https://reference.wolfram.com/language/ref/Curry.html}, note=[Accessed: 15-June-2026]}