Elm Exactly

Rule 8s-atexp-record

Atomic ExpressionsC⊢atexp⇒τ\jdg{C}{\atexp}{\tau}
⟨C⊢exprow⇒ϱ⟩C⊢{ ⟨exprow⟩ }⇒{{}⟨+ϱ⟩}\frac{\begin{array}{c}\opt{\jdg{C}{\exprow}{\varrho}}\end{array}}{\begin{array}{c}\jdg{C}{\kw{\kwlb}\,\opt{\exprow}\,\kw{\kwrb}}{\rec{\emptymap\opt{{}+\varrho}}}\end{array}}
(8)
Read it in its chapter·Permanent address: /standard/rules/s-atexp-record

Comments

A record expression has a closed record type: its fields are exactly those written.

TeX source
\defnrule[r:s-atexp-record]
  {\opt{\jdg{C}{\exprow}{\varrho}}}
  {\jdg{C}{\kw{\kwlb}\,\opt{\exprow}\,\kw{\kwrb}}{\rec{\emptymap\opt{{}+\varrho}}}}

Tests (11)

Discussions

Discuss this rule·Search the discussions on GitHub

Discussions are on GitHub; one about this rule has [r:s-atexp-record] 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.