Rule 130dm-datbind
Custom-type Bindings
(130)
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 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)
- elm / CustomTypeMultiFieldTestA value of a custom type whose constructor has three arguments of different types (`String`, `Int`, `Bool`) can be built and logged.
- elm / MinimalCustomTypeTestA custom type with one constructor.
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.