Elm Exactly

Rule 37s-atpat-tuple

Atomic PatternsC⊢atpat⇒(VE,τ)\jdg{C}{\atpat}{(\VE, \tau)}
C⊢pati⇒(VEi,τi)(1≤i≤k)C⊢( pat1, ⋯, patk )⇒(VE1+⋯+VEk, (τ1,⋯ ,τk)Tuplek)\frac{\begin{array}{c}\jdg{C}{\pat_i}{(\VE_i, \tau_i)} \quad (1 \le i \le k)\end{array}}{\begin{array}{c}\jdg{C}{\kw{(}\,\pat_1\kw{,}\ \cdots\kw{,}\ \pat_k\,\kw{)}}{(\VE_1 + \cdots + \VE_k,\ (\tau_1, \cdots, \tau_k)\tTuple{k})}\end{array}}
(37)
Read it in its chapter·Permanent address: /standard/rules/s-atpat-tuple

Comments

By the grammar kk is 2 or 3, and by the syntactic restrictions the domains of the VEi\VE_i are disjoint.

TeX source
\defnrule[r:s-atpat-tuple]
  {\jdg{C}{\pat_i}{(\VE_i, \tau_i)} \quad (1 \le i \le k)}
  {\jdg{C}{\kw{(}\,\pat_1\kw{,}\ \cdots\kw{,}\ \pat_k\,\kw{)}}{(\VE_1 + \cdots + \VE_k,\ (\tau_1, \cdots, \tau_k)\tTuple{k})}}

Tests (12)

Discussions

Discuss this rule·Search the discussions on GitHub

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