Elm Exactly

Figureappendix-standard-ml-polymorphism

Figure 58, Standard ML and Elm: Polymorphism and Type Variables, in Section F.2 Differences by Construct.

FeatureStandard MLElm (this definition)Where defined here
Value polymorphismA value restriction: only a non-expansive expression has its type generalised.No value restriction: closure applies to every binding, whatever its expression.Sec. 4.8; Sec. 4.9
Explicit type variablesBound at a value declaration, explicitly (val 'a) or implicitly at the outermost value declaration in which they occur. Type constraints exp\expm : ty\ty on any expression or pattern.No binder: the type variables of an annotation scope over the annotations nested in its definition, and may not escape it. Annotations are given only for definitions and ports.Sec. 4.7
Figure 58: Standard ML and Elm: Polymorphism and Type Variables
Read it in its chapter·Permanent address: /standard/figures/appendix-standard-ml-polymorphism

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