Elm Exactly

Rule 122dm-expitem-type

Exposing ItemsI⊢item⇒I′\jdg{I}{\expitem}{I'}
tycon∉RAofICE={tycon↦{} ; tycon∈Dom (CEofI)}I⊢tycon⇒(∅,CE,{})\frac{\begin{array}{c}\tycon\notin\dmRA\of I\premsep \dmCE=\{\tycon\mapsto\emptymap\,;\,\tycon\in\Dom(\dmCE\of I)\}\end{array}}{\begin{array}{c}\jdg{I}{\tycon}{(\emptyset,\dmCE,\emptymap)}\end{array}}
(122)
Read it in its chapter·Permanent address: /standard/rules/dm-expitem-type

Comments

A custom type exposed without (..) exposes no value, even when one of its constructors is spelt as the type: in a module with type Id = Id Int and header exposing (Id), the constructor Id is not exposed. The type is still exposed, closed: the constructor environment maps it to the empty map, so that an import of Id(..) has a meaning (rule (123)). An alias of a type other than a closed record is in neither RAofI\dmRA\of I nor Dom (CEofI)\Dom(\dmCE\of I), and exposes nothing.

Referred to from

TeX source
\defnrule[r:dm-expitem-type]
  {\tycon\notin\dmRA\of I\premsep
   \dmCE=\{\tycon\mapsto\emptymap\,;\,\tycon\in\Dom(\dmCE\of I)\}}
  {\jdg{I}{\tycon}{(\emptyset,\dmCE,\emptymap)}}

Tests (2)

Discussions

Discuss this rule·Search the discussions on GitHub

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