Elm Exactly

Rule 44s-pat-cons

PatternsC⊢pat⇒(VE,τ)\jdg{C}{\pat}{(\VE, \tau)}
C⊢pat1⇒(VE1,τ)C⊢pat2⇒(VE2,τ List)C⊢pat1 :: pat2⇒(VE1+VE2, τ List)\frac{\begin{array}{c}\jdg{C}{\pat_1}{(\VE_1, \tau)} \premsep \jdg{C}{\pat_2}{(\VE_2, \tau\,\tList)}\end{array}}{\begin{array}{c}\jdg{C}{\pat_1\ \kw{::}\ \pat_2}{(\VE_1 + \VE_2,\ \tau\,\tList)}\end{array}}
(44)
Read it in its chapter·Permanent address: /standard/rules/s-pat-cons

Comments

The type name is List\tList of the initial basis, whatever the program binds to List.

TeX source
\defnrule[r:s-pat-cons]
  {\jdg{C}{\pat_1}{(\VE_1, \tau)} \premsep \jdg{C}{\pat_2}{(\VE_2, \tau\,\tList)}}
  {\jdg{C}{\pat_1\ \kw{::}\ \pat_2}{(\VE_1 + \VE_2,\ \tau\,\tList)}}

Tests (5)

Discussions

Discuss this rule·Search the discussions on GitHub

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