Repository navigation
Haskell
Arrows, logic, comparisons and Greek letters for Haskell. Requires an extension that provides the language id haskell (e.g. the Haskell extension).
The rules go into your VS Code settings.json. Open the command palette (Ctrl+Shift+P) and run Preferences: Open User Settings (JSON) to enable them for all projects, or edit .vscode/settings.json to enable them for one workspace. Add an entry for this language to the prettifySymbols.substitutions array (if the setting already exists, add the entry to the existing array; entries for different languages sit side by side):
Changes take effect as soon as you save settings.json. The extension is enabled by default; the animation at the bottom starts with it switched off only to show the difference.
"language": "haskell",language selects the files the entry applies to: a language id as shown in the status bar at the bottom right of VS Code. The page for Coq shows how to combine it with a file pattern.
{ "ugly": "\\\\", "pretty": "λ", "post": "\\s*(?:\\w|_).*?\\s*->" },
{ "ugly": "->", "pretty": "→" },
{ "ugly": "<-", "pretty": "←" },
{ "ugly": "==", "pretty": "≡" },
{ "ugly": "/=", "pretty": "≢" },
{ "ugly": "\\(\\)", "pretty": "∅" },
{ "ugly": "&&", "pretty": "∧" },
{ "ugly": "\\|\\|", "pretty": "∨" },
{ "ugly": "not\\s?", "pretty": "¬", "pre": "\\b", "post": "\\b" },
{ "ugly": "sqrt\\s?", "pretty": "√", "pre": "\\b", "post": "\\b" },
{ "ugly": ">", "pretty": ">", "pre": "[^=\\-<>]|^", "post": "[^=\\-<>]|$" },
{ "ugly": "<", "pretty": "<", "pre": "[^=\\-<>]|^", "post": "[^=\\-<>]|$" },
{ "ugly": ">=", "pretty": "≥", "pre": "[^=\\-<>]|^", "post": "[^=\\-<>]|$" },
{ "ugly": "<=", "pretty": "≤", "pre": "[^=\\-<>]|^", "post": "[^=\\-<>]|$" },
{ "ugly": "alpha", "pretty": "α", "pre": "\\b", "post": "\\b" },
{ "ugly": "beta", "pretty": "β", "pre": "\\b", "post": "\\b" },
{ "ugly": "gamma", "pretty": "γ", "pre": "\\b", "post": "\\b" },
{ "ugly": "delta", "pretty": "δ", "pre": "\\b", "post": "\\b" },
{ "ugly": "''", "pretty": "″" },
{ "ugly": "'", "pretty": "′" },
{ "ugly": "!!", "pretty": "‼" },
{ "ugly": "\\.\\.", "pretty": "…" }Each rule is one line: ugly is a regular expression for the text to hide, pretty is what is shown instead, and the optional pre and post are regular expressions that must match the text just before and after, without being replaced themselves. Backslashes are written twice because the value is parsed by JSON and then as a regular expression. See Settings for all fields.
-
\\(the lambda backslash): replaced byλonly if it is followed by arguments and a->, so a stray backslash elsewhere is left alone. Note the four backslashes in the JSON: one literal backslash, escaped twice. -
->,<-,==,/=,():→,←,≡,≢,∅. -
&&,||,not:∧,∨,¬.notandsqrtswallow an optional following space, sonot xbecomes¬x. -
>,<,>=,<=: comparisons.>and<are replaced by themselves; they are kept from the original page and can be removed. Thepre/postclasses keep>=,->,<-and friends from being split into pieces. -
alpha,beta,gamma,delta:α β γ δ, only as whole words. -
'and'': primes′and″, e.g.x'andx''. -
!!and..:‼and….
Note: symbol 'not identical to' (≢ ≢) is not always rendered correctly in Chrome on Windows. Potential alternative: ⧥.

The animation is rendered from the rules on this page. The code is never modified: clicking into a symbol (or moving the cursor onto it) shows the original text again, and the symbol returns when the cursor leaves.