Function Repository Resource:

CombinatorTraditionalForm

Source Notebook

Display a combinator expression in a default styled form

Contributed by: Wolfram Research

ResourceFunction["CombinatorTraditionalForm"][cmb]

display the combinator expression cmb in left-associative parenthetical form with no application glyph.

Details and Options

The argument cmb should be given as a combinator expression in nested bracket form.
ResourceFunction["CombinatorTraditionalForm"] only accepts one option:
"UseCombinatorGlyphs"Automaticwhich symbols to replace with combinator glyphs
"UseCombinatorGlyphs" accepts the settings Automatic and All, which map lowercase letter symbols to the corresponding combinator glyphs. Automatic assumes that only S and K combinators are used, whereas All uses all seven built-in combinator glyphs. The setting None causes no combinator glyphs to be used. The user can also give a list for this option that specifies which symbols should be replaced with combinator glyphs, as long as the option value matches the built-in order of glyphs, {CombinatorS, CombinatorK, CombinatorI, CombinatorB, CombinatorC, CombinatorW, CombinatorY}.

Examples

Basic Examples (4) 

Display a combinator expression that uses combinator glyphs in traditional form:

In[1]:=
ResourceFunction["CombinatorTraditionalForm"][
 CombinatorS[CombinatorS[CombinatorK][CombinatorY][CombinatorK]][
   CombinatorY][CombinatorK]]
Out[1]=

Display a combinator expression that does not use combinator glyphs in traditional form, automatically using the S and K combinator glyphs:

In[2]:=
ResourceFunction["CombinatorTraditionalForm"][s[s[k][y][k]][y][k]]
Out[2]=

Display a combinator expression in traditional form, specifying that all combinator glyphs should be used:

In[3]:=
ResourceFunction["CombinatorTraditionalForm"][s[s[k][y][k]][y][k], "UseCombinatorGlyphs" -> All]
Out[3]=

Display a combinator expression in traditional form, specifying that no combinator glyphs should be used:

In[4]:=
ResourceFunction["CombinatorTraditionalForm"][s[s[k][y][k]][y][k], "UseCombinatorGlyphs" -> None]
Out[4]=

Display a combinator expression in traditional form, specifying that only the CombinatorS glyph should be used:

In[5]:=
ResourceFunction["CombinatorTraditionalForm"][s[s[k][y][k]][y][k], "UseCombinatorGlyphs" -> {s}]
Out[5]=

Display a combinator expression in traditional form, specifying that only the CombinatorS and CombinatorY glyphs should be used:

In[6]:=
ResourceFunction["CombinatorTraditionalForm"][s[s[k][y][k]][y][k], "UseCombinatorGlyphs" -> {s, None, None, None, None, None, y}]
Out[6]=

Version History

  • 1.0.0 – 08 March 2021

Related Resources

License Information