Elm Exactly

Rule 123dm-expitem-open

Exposing ItemsI⊢item⇒I′\jdg{I}{\expitem}{I'}
(CEofI)(tycon)=VEI⊢tycon (..)⇒(∅,{tycon↦VE},VE)\frac{\begin{array}{c}(\dmCE\of I)(\tycon)=\VE\end{array}}{\begin{array}{c}\jdg{I}{\tycon\,\kw{(..)}}{(\emptyset,\{\tycon\mapsto\VE\},\VE)}\end{array}}
(123)
Read it in its chapter·Permanent address: /standard/rules/dm-expitem-open

Comments

By elaboration, tycon\tycon names a custom type that II exposes, so (CEofI)(tycon)(\dmCE\of I)(\tycon) is defined; an item tycon (..)\tycon\,\kw{(..)} for an alias is rejected (Chapters 3 and 5). In a header, II is the module’s own interface, which holds every constructor of tycon\tycon. In an import, VE\VE holds the constructors that the imported module exposes, and is the empty map when it exposes tycon\tycon closed: with module A exposing (T), type T = T Int and import A exposing (T(..)), the import makes no constructor available.

Referred to from

TeX source
\defnrule[r:dm-expitem-open]
  {(\dmCE\of I)(\tycon)=\VE}
  {\jdg{I}{\tycon\,\kw{(..)}}{(\emptyset,\{\tycon\mapsto\VE\},\VE)}}

Tests (3)

Discussions

Discuss this rule·Search the discussions on GitHub

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