Wolfram Function Repository
Instantuse addon functions for the Wolfram Language
Function Repository Resource:
Visualize a static combinator expression
ResourceFunction["CombinatorPlot"][cmb,"FramedMatches"] highlights rule matches in the combinator expression cmb. 

ResourceFunction["CombinatorPlot"][cmb,{"FramedPositions",posns}] highlights rule matches at given positions posns in the combinator expression cmb. 

ResourceFunction["CombinatorPlot"][cmb,type] displays various kinds of characterbased forms or array lists of cmb, depending on the type chosen. 
"Characters"  displays cmb with any specified glyphs and glyph styling 
"CharactersLeftAssociative"  displays cmb assuming leftassociativity of application operator 
"CharactersRightAssociative"  displays cmb assuming rightassociativity of application operator 
"CharactersPolishNotation"  displays cmb using parenthesisfree operator prefix notation 
"CharactersReversePolishNotation"  displays cmb using parenthesisfree operator postfix notation 
"ArrayList"  directly transforms cmb into a form usable in ArrayPlot 
"ArrayListLeftAssociative"  transforms leftassociative form of cmb into form usable by ArrayPlot 
"ArrayListRightAssociative"  transforms rightassociative form of cmb into form usable by ArrayPlot 
"ArrayListPolishNotation"  transforms Polish notation form of cmb into form usable by ArrayPlot 
"ArrayListReversePolishNotation"  transforms reverse Polish notation form of cmb into form usable by ArrayPlot 
"ArrayListBracketsOnly"  transforms bracket structure of cmb into form usable by ArrayPlot 
"SKGlyphs"  Automatic  glyphs used for S and K combinators in cmb 
"ApplicationGlyph"  ""  glyph and styles used for application operator 
"ColorCombinatorNames"  False  whether combinator names should be colored in characters form 
"CombinatorRules"  Automatic  combinator rules used to evolve cmb 
"CombinatorStyles"  Automatic  highlight/detail coloring and text style for rule matches in cmb 
"EvaluationScheme"  {"Leftmost","Outermost",1}  evaluation scheme used to evolve cmb 
"FormatFunction"  DisplayForm  function used to format character form of cmb 
"IncludeArgumentFraming"  True  whether combinator/arguments are separated in match highlighting 
"IncludeBackgroundFraming"  False  whether nonhighlighted matches are shown on cmb 
"ParenthesisGlyphs"  {"(",")"}  glyphs and styles used to represent parentheses 
"UseCombinatorGlyphs"  None  which combinators should be represented with their glyphs 
Show the leftmost outermost rule match in a combinator expression:
In[1]:= 

Out[1]= 

Show all matches in a combinator expression:
In[2]:= 

Out[2]= 

Show all the rule matches in a combinator expression without showing the separation between the combinator and its arguments:
In[3]:= 

Out[3]= 

Highlight matches for a selected combinator evaluation scheme:
In[4]:= 

Out[4]= 

As well as highlighting all matches within a selected combinator evaluation scheme, indicate where all other rule matches occur:
In[5]:= 

Out[5]= 

Highlight selected positions in a combinator expression, given that the positions correspond to rule matches:
In[6]:= 

Out[6]= 

Show a combinator expression with colored combinator glyphs:
In[7]:= 

Out[7]= 

Show a combinator expression with colored combinator glyphs. Note that the Automatic value for "UseCombinatorGlyphs" sets the assumption that the CombinatorS and CombinatorK glyphs should be used for the corresponding characters:
In[8]:= 

Out[8]= 

Show a combinator expression assuming that all seven builtin combinator glyphs should be used:
In[9]:= 

Out[9]= 

Display a combinator expression in traditional form with the leftassociative application operator, combinator glyphs, and styled parentheses:
In[10]:= 

Out[10]= 

Display a combinator expression in traditional form with rightassociative application, combinator glyphs, and styled brackets:
In[11]:= 

Out[11]= 

Display a combinator expression in Polish (prefix) notation:
In[12]:= 

Out[12]= 

Display a combinator expression in reverse Polish (postfix) notation:
In[13]:= 

Out[13]= 

Define rules and styling for match highlighting in a combinator expression:
In[14]:= 

Out[14]= 

Return information about a combinator expression usable in an ArrayPlot; the first association contains rule match expression positions and rule numbers, the second list contains character lengths of the rule matches, the third list contains character positions at which the rule matches begin and the last list contains a form of the combinator expression that can be used in ArrayPlot:
In[15]:= 

Out[15]= 

Display an array plot for a static combinator expression:
In[16]:= 

Out[16]= 

Render an array plot of a leftassociative combinator expression:
In[17]:= 

Out[17]= 

Render an array plot of a rightassociative combinator expression:
In[18]:= 

Out[18]= 

Render an array plot of a combinator expression in Polish notation:
In[19]:= 

Out[19]= 

Render an array plot of a combinator expression in reverse Polish notation:
In[20]:= 

Out[20]= 

Render an array plot of a combinator expression in bracketsonly form:
In[21]:= 

Out[21]= 

This work is licensed under a Creative Commons Attribution 4.0 International License