Elm Exactly

Figureappendix-standard-ml-evaluation

Figure 56, Standard ML and Elm: Evaluation, in Section F.2 Differences by Construct.

FeatureStandard MLElm (this definition)Where defined here
Exceptionsexception declarations, raise and handle; exception names and packets; an exception convention for the dynamic rules.None: no exception names, no packets, no exception convention. Evaluation of a phrase either gives a value or gives none; absence and failure are values of the types Maybe and Result of the initial basis.Ch. 6, Sec. 6.7; Sec. C.4
Incomplete matchesAllowed; a match that fails raises Match, a value binding that fails raises Bind.Not allowed: every match, lambda pattern and destructuring binding must be exhaustive, and every match rule must be needed, at the types of the principal derivation.Sec. 4.11; Sec. 4.10
StateReferences (ref, :=, !), addresses and states; a state convention, under which the order of premises is the order of evaluation.None: sentences carry no state, and no state convention is needed. The order of premises has no meaning; the order of evaluation is observable only through Debug, and is left to the implementation.Sec. 6.7; Sec. E.6
Arithmetic failureOverflow is raised when a result leaves the range of int; Div when a divisor is zero.Total: every Int result is normalised into the implementation’s range, and an operation with no correct result gives a defined one; thus 3 // 0 is 0.Ch. D; Sec. E.1
EqualityEquality types: type variables ''a, an equality attribute on type names; = at a function type does not elaborate.No equality types: == elaborates at every type. When it reaches two functions its result is an unspecified Bool, so evaluation may be non-deterministic.Sec. 4.4; Sec. D.4; Sec. E.4
Figure 56: Standard ML and Elm: Evaluation
Read it in its chapter·Permanent address: /standard/figures/appendix-standard-ml-evaluation

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-evaluation] 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.