In[]:=
Function[x,x+1][8]
Out[]=
9
In[]:=
(x|->x+1)[10]
Out[]=
11
In[]:=
Function[x,x+y][10]
Out[]=
10+y
In[]:=
Function[y,Function[x,x+y]][10][17]
Out[]=
27
In[]:=
Function[y,Function[x,x+y]][a]
In[]:=
Function[x$,x$+a][b]
Out[]=
a+b
f[x][y]
f[x,y]
In[]:=
Plus[2,3,4]
Out[]=
9
λx.x+1
Function[x,Function[x,x+x]]
In[]:=
Function[z,Function[x,x+z]]
Out[]=
Function[z,Function[x,x+z]]
In[]:=
Function[y,Function[x,x+y]]
Out[]=
Function[y,Function[x,x+y]]
In[]:=
PacletInstall["Wolfram/Lambda"]
Out[]=
PacletObject
In[]:=
Needs["Wolfram`Lambda`"]
In[]:=
Out[]=
λ.[λ.[2[1]][λ.[2[1]]]][x.]
In[]:=
Out[]=
{λ.[1],λ.[1[1]]}
x|->x
x|->x[x]
In[]:=
Out[]=
{x,x[x]}
In[]:=
Out[]=
{x,λ.[1],λ.[x],λ.[1[1]],λ.[1[x]],λ.[x[1]],λ.[x[x]],x[x],x[λ.[1]],x[λ.[x]],x[λ.[1[1]]],x[λ.[1[x]]],x[λ.[x[1]]],x[λ.[x[x]]],x,λ.[1],λ.[x],λ.[1[1]],λ.[1[x]],λ.[x[1]],λ.[x[x]],x,x,x,x,x,x,x,x[x],λ.[1],x,TerminatedEvaluation[IterationLimit],x[x],x[λ.[x[1]]],x[x],x[x],x,x,x[x],x[x],x[x],x[x],x[x],x[λ.[1]],x[λ.[x]],x[λ.[1[1]]],x[λ.[1[x]]],x[λ.[x[1]]],x[λ.[x[x]]],x[x],x[x],x[x],x[x],x[x],x[x],x[x]}
In[]:=
#->[#[x]]&/@[2,2]
Out[]=
{λ.[1]x,λ.[λ.[1]]λ.[1],λ.[λ.[2]]λ.[x],λ.[λ.[1[1]]]λ.[1[1]],λ.[λ.[1[2]]]λ.[1[x]],λ.[λ.[2[1]]]λ.[x[1]],λ.[λ.[2[2]]]λ.[x[x]],λ.[1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λ.[1[x]]],λ.[λ.[2[1]][λ.[2[1]]]]x[λ.[x[1]]],λ.[λ.[2[1]][λ.[2[2]]]]x[λ.[x[x]]],λ.[λ.[2[2]][1]]x[x],λ.[λ.[2[2]][λ.[1]]]x[x],λ.[λ.[2[2]][λ.[2]]]x[x],λ.[λ.[2[2]][λ.[1[1]]]]x[x],λ.[λ.[2[2]][λ.[1[2]]]]x[x],λ.[λ.[2[2]][λ.[2[1]]]]x[x],λ.[λ.[2[2]][λ.[2[2]]]]x[x]}
In[]:=
Take[2,2],5
Out[]=
{λ.[1],λ.[λ.[1]],λ.[λ.[2]],λ.[λ.[1[1]]],λ.[λ.[1[2]]]}
In[]:=
Trace[λ.[λ.[1[2]][λ.[1]]][x]],_LambdaSubstitute
Out[]=
{{{{{LambdaSubstitute[λ.[1],1x],{LambdaSubstitute[1,2x]}}}}},{LambdaSubstitute[1[2],1λ.[1],2x],{LambdaSubstitute[1,1λ.[1],2x]},{LambdaSubstitute[2,1λ.[1],2x]}},{LambdaSubstitute[1,1x]}}
In[]:=
ResourceFunction["TraceGraph"][λ.[λ.[1[2]][λ.[1]]][x]],_LambdaSubstitute
Out[]=
x |-> (E [x])
Eta reduction: