Elm Exactly

Rule 45s-pat-as

PatternsC⊢pat⇒(VE,τ)\jdg{C}{\pat}{(\VE, \tau)}
C⊢pat⇒(VE,τ)C⊢pat as var⇒(VE+{var↦(τ,v)}, τ)\frac{\begin{array}{c}\jdg{C}{\pat}{(\VE, \tau)}\end{array}}{\begin{array}{c}\jdg{C}{\pat\ \kw{as}\ \var}{(\VE + \{\var \mapsto (\tau, \isv)\},\ \tau)}\end{array}}
(45)
Read it in its chapter·Permanent address: /standard/rules/s-pat-as

Comments

The syntactic restrictions ensure var∉Dom VE\var \notin \Dom\VE.

TeX source
\defnrule[r:s-pat-as]
  {\jdg{C}{\pat}{(\VE, \tau)}}
  {\jdg{C}{\pat\ \kw{as}\ \var}{(\VE + \{\var \mapsto (\tau, \isv)\},\ \tau)}}

Tests (3)

Discussions

Discuss this rule·Search the discussions on GitHub

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