Elm Exactly

Figureappendix-standard-ml-syntax

Figure 60, Standard ML and Elm: Syntax, in Section F.2 Differences by Construct.

FeatureStandard MLElm (this definition)Where defined here
Infixed operatorsinfix, 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 (op\opv) uses an operator as a function.Sec. 2.7, Fig. 3
LayoutInsensitive 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
Recursionval 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
Functionsfn 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
Figure 60: Standard ML and Elm: Syntax
Read it in its chapter·Permanent address: /standard/figures/appendix-standard-ml-syntax

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.