Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Convert between different combinator formats
ResourceFunction["CombinatorConvert"][cmb,format] converts a combinator expression cmb to the specified format. | |
ResourceFunction["CombinatorConvert"][transform] interconverts a combinator transformation rule transform between the RuleDelayed and Function formats. | |
ResourceFunction["CombinatorConvert"][transform,name] interconverts a combinator transformation rule transform using the symbol name to designate the combinator on the left-hand side when converting to RuleDelayed. |
"Application" | combinator represented in terms of Application,S![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
"List" | combinator represented as a list, {{{{S, {K, {S,I}}}, {{S, {K,K}}, I}}, x}, y} |
"Nested" | combinator in nested bracket format, S[K[S[I]]][S[K[K]][I]][x][y] |
"String" | combinator represented as a left-associative string, "S(K(SI))(S(KK)I)xy" |
Convert a combinator expression in application format to each of the possible formats:
In[1]:= | ![]() |
Out[1]= | ![]() |
In[2]:= | ![]() |
Out[2]= | ![]() |
In[3]:= | ![]() |
Out[3]= | ![]() |
In[4]:= | ![]() |
Out[4]= | ![]() |
Convert a combinator expression in nested bracket format to each of the possible formats:
In[5]:= | ![]() |
Out[5]= | ![]() |
In[6]:= | ![]() |
Out[6]= | ![]() |
In[7]:= | ![]() |
Out[7]= | ![]() |
In[8]:= | ![]() |
Out[8]= | ![]() |
Convert a combinator expression in list format to each of the possible formats:
In[9]:= | ![]() |
Out[9]= | ![]() |
In[10]:= | ![]() |
Out[10]= | ![]() |
In[11]:= | ![]() |
Out[11]= | ![]() |
In[12]:= | ![]() |
Out[12]= | ![]() |
Convert a combinator expression in list format to each of the possible formats (note that the conversion from string format only allows single-character symbols, so combinator glyphs would need to be inserted retroactively):
In[13]:= | ![]() |
Out[13]= | ![]() |
In[14]:= | ![]() |
Out[14]= | ![]() |
In[15]:= | ![]() |
Out[15]= | ![]() |
In[16]:= | ![]() |
Out[16]= | ![]() |
Convert between the RuleDelayed and Function formats of the CombinatorB transformation:
In[17]:= | ![]() |
Out[17]= | ![]() |
In[18]:= | ![]() |
Out[18]= | ![]() |
When converting from Function to RuleDelayed, a second argument must be supplied for the correct symbol to appear on the left-hand side:
In[19]:= | ![]() |
Out[19]= | ![]() |
Input strings containing any symbol other than letters, digits or parentheses are currently not supported:
In[20]:= | ![]() |
Out[20]= | ![]() |
Input strings must be in left-associative format:
In[21]:= | ![]() |
Out[21]= | ![]() |
A combinator transformation must be a RuleDelayed or Function object:
In[22]:= | ![]() |
Out[22]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License