Elm Exactly

Figurecore-grammar-types

Figure 7, Grammar: Type Expressions, in Section 2.9 Grammar.

ty\ty::=tyvar\tyvartype variable
{ ⟨tyrow⟩ }\kw{\kwlb}\ \opt{\tyrow}\ \kw{\kwrb}record type expression
{ tyvar | tyrow }\kw{\kwlb}\ \tyvar\ \kw{|}\ \tyrow\ \kw{\kwrb}extensible record type expression
()\kw{()}unit type expression
( ty1 , ty2 ⟨, ty3⟩ )\kw{(}\ \ty_1\ \kw{,}\ \ty_2\ \opt{\kw{,}\ \ty_3}\ \kw{)}tuple type expression
longtycon ty1 ⋯ tyn\longtycon\ \ty_1\ \cdots\ \ty_ntype construction (n≥0n \geq 0)
ty -> ty′\ty\ \kw{->}\ \ty'function type expression (R)
( ty )\kw{(}\ \ty\ \kw{)}parentheses
tyrow\tyrow::=lab : ty ⟨, tyrow⟩\lab\ \kw{:}\ \ty\ \opt{\kw{,}\ \tyrow}type-expression row
Figure 7: Grammar: Type Expressions
Read it in its chapter·Permanent address: /standard/figures/core-grammar-types

Referred to from

Tests (1)

Discussions

Discuss this figure·Search the discussions on GitHub

Discussions are on GitHub; one about this figure has [fig:core-grammar-types] 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.