Figureappendix-standard-ml-syntax
| Feature | Standard ML | Elm (this definition) | Where defined here |
| Infixed operators | infix, infixr and nonfix declarations in programs, scoped like other declarations; op removes infix status. | The fixities are fixed by the initial basis and by library modules; no program declares an operator. Some operators are non-associative. The operator value () uses an operator as a function. | Sec. 2.7, Fig. 3 |
| Layout | Insensitive to layout; phrases are delimited by reserved words such as end and by ;. | Sensitive to indentation: match rules, the definitions of a let and the declarations of a module are separated by layout, and ; and and are abstract syntax. | Sec. 2.6; Sec. 3.4 |
| Recursion | val rec and fun with and group recursive bindings as written; each declaration is in scope only after it. | The definitions of a let and the declarations of a module stand in any order and are grouped, by derived forms, into components of the “refers to” relation in dependency order. In a let, recursion passes only through definitions with parameters. | Sec. A.1; Sec. A.2; Sec. 2.10 |
| Functions | fn takes a match; fun defines a function by several clauses. | A lambda expression takes atomic patterns and has one body; a function binding has one clause; several cases are written with case. | Fig. 5; App. A |
Referred to from
Tests (0)
No test of the suite checks this figure yet.
Discussions
Discuss this figure·Search the discussions on GitHub
Discussions are on GitHub; one about this figure has [fig:appendix-standard-ml-syntax] in its title.
A Standard Definition of Elm? (Draft version 0.4) © Rupert Smith. The text is licensed under CC BY 4.0: share and adapt it freely, with credit and a link to the licence.