Elm Exactly

Rule 21s-valbind-pat

Value BindingsC⊢valbind⇒VE\jdg{C}{\valbind}{\VE}
C⊢atpat⇒(VE,τ)C⊢exp⇒τC⊢atpat = exp⇒VE\frac{\begin{array}{c}\jdg{C}{\atpat}{(\VE, \tau)} \premsep \jdg{C}{\expm}{\tau}\end{array}}{\begin{array}{c}\jdg{C}{\atpat\ \kw{=}\ \expm}{\VE}\end{array}}
(21)
Read it in its chapter·Permanent address: /standard/rules/s-valbind-pat

Comments

A pattern binding is a group by itself. The variables of atpat\atpat receive types here and are generalised by rule (19). That rule also puts them in scope in exp\expm, but the syntactic restrictions forbid exp\expm to use them, since no pattern binding lies on a cycle of definitions. A binding var = exp\var\ \kw{=}\ \expm is read by rule (20).

TeX source
\defnrule[r:s-valbind-pat]
  {\jdg{C}{\atpat}{(\VE, \tau)} \premsep \jdg{C}{\expm}{\tau}}
  {\jdg{C}{\atpat\ \kw{=}\ \expm}{\VE}}

Tests (25)

Discussions

Discuss this rule·Search the discussions on GitHub

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