Elm Exactly

Rule 130dm-datbind

Custom-type Bindings⊢datbind⇒(CE,VE)\jdg{}{\datbind}{(\dmCE,\VE)}
⊢conbind⇒VE⟨⊢datbind⇒(CE,VE′)⟩⊢tycon = conbind ⟨and datbind⟩⇒({tycon↦VE}⟨+ CE⟩, VE⟨+ VE′⟩)\frac{\begin{array}{c}\jdg{}{\conbind}{\VE}\premsep\opt{\jdg{}{\datbind}{(\dmCE,\VE')}}\end{array}}{\begin{array}{c}\jdg{}{\tycon\ \kw{=}\ \conbind\ \opt{\kw{and}\ \datbind}} {(\{\tycon\mapsto\VE\}\opt{+\,\dmCE},\ \VE\opt{+\,\VE'})}\end{array}}
(130)
Read it in its chapter·Permanent address: /standard/rules/dm-datbind

Comments

No type names are generated: a custom type has no dynamic content beyond its constructors. The constructors of a module are distinct (Section 3.7), so the modification of VE\VE replaces no binding.

TeX source
\defnrule[r:dm-datbind]
  {\jdg{}{\conbind}{\VE}\premsep\opt{\jdg{}{\datbind}{(\dmCE,\VE')}}}
  {\jdg{}{\tycon\ \kw{=}\ \conbind\ \opt{\kw{and}\ \datbind}}
     {(\{\tycon\mapsto\VE\}\opt{+\,\dmCE},\ \VE\opt{+\,\VE'})}}

Tests (2)

Discussions

Discuss this rule·Search the discussions on GitHub

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