Elm Exactly

Figuregrammar-top-level-declarations

Figure 10, Grammar: Top-level Declarations and Bindings, in Section 3.5 Grammar for Modules.

topdec\topdec::=valbind\valbindvalue
type datbind\kw{type}\ \datbindcustom type
type alias typbind\kw{type}\ \kw{alias}\ \typbindtype alias
port var : ty\kw{port}\ \var\ \kw{:}\ \typort
topdec1 ; topdec2\topdec_1\ \kw{;}\ \topdec_2sequential
datbind\datbind::=tycon tyvarseq = conbind\tycon\ \tyvarseq\ \kw{=}\ \conbindcustom-type binding
⟨and datbind⟩\qquad\opt{\kw{and}\ \datbind}
conbind\conbind::=con ty1 ⋯ tyn ⟨| conbind⟩\con\ \ty_1\ \cdots\ \ty_n\ \opt{\kw{|}\ \conbind}constructor binding
(n≥0)(n \geq 0)
typbind\typbind::=tycon tyvarseq = ty\tycon\ \tyvarseq\ \kw{=}\ \tytype-alias binding
tyvarseq\tyvarseq::=tyvar1 ⋯ tyvark\tyvar_1\ \cdots\ \tyvar_ktype parameters
(k≥0)(k \geq 0)
Figure 10: Grammar: Top-level Declarations and Bindings
Read it in its chapter·Permanent address: /standard/figures/grammar-top-level-declarations

Referred to from

Tests (1)

Discussions

Discuss this figure·Search the discussions on GitHub

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