Elm Exactly

Rule 15s-exp-lambda

ExpressionsC⊢exp⇒τ\jdg{C}{\expm}{\tau}
C⊢atpat⇒(VE,τ)C+VE⊢exp⇒τ′C⊢\ atpat -> exp⇒τ→τ′\frac{\begin{array}{c}\jdg{C}{\atpat}{(\VE, \tau)} \premsep \jdg{C + \VE}{\expm}{\tau'}\end{array}}{\begin{array}{c}\jdg{C}{\kw{\textbackslash}\ \atpat\ \kw{->}\ \expm}{\tau \rightarrow \tau'}\end{array}}
(15)
Read it in its chapter·Permanent address: /standard/rules/s-exp-lambda

Comments

The variables bound by atpat\atpat receive types, not type schemes, so a parameter has one type throughout exp\expm. Restriction 2 of Section 4.11 requires atpat\atpat to be exhaustive.

TeX source
\defnrule[r:s-exp-lambda]
  {\jdg{C}{\atpat}{(\VE, \tau)} \premsep \jdg{C + \VE}{\expm}{\tau'}}
  {\jdg{C}{\kw{\textbackslash}\ \atpat\ \kw{->}\ \expm}{\tau \rightarrow \tau'}}

Tests (17)

Discussions

Discuss this rule·Search the discussions on GitHub

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