Elm Exactly

Rule 55sm-item-opentype

Exposing Itemsmodid,I⊢item⇒(N,N′)\jdg{\modid, I}{\expitem}{(N, N')}
I(tycon)=(θ,VE)VE(con)=(σ,c) for some con,σmodid,I⊢tycon (..)⇒({tycon}, Dom VE∩Dom (VEofI))\frac{\begin{array}{c}I(\tycon) = (\theta, \VE) \premsep \VE(\con) = (\sigma, \isc) \text{ for some } \con, \sigma\end{array}}{\begin{array}{c}\jdg{\modid, I}{\tycon\,\kw{(..)}}{(\{\tycon\},\ \Dom\VE \cap \Dom(\VE \of I))}\end{array}}
(55)
Read it in its chapter·Permanent address: /standard/rules/sm-item-opentype

Comments

The side condition holds only for a custom type, so Alias(..) does not elaborate for an alias. For a type that its module exposes closed, no constructor is in Dom (VEofI)\Dom(\VE \of I), so the item elaborates, imports the type and imports no constructors: after import A exposing (T(..)), where A exposes T closed, the constructors of T are not available.

TeX source
\defnrule[r:sm-item-opentype]
  {I(\tycon) = (\theta, \VE) \premsep \VE(\con) = (\sigma, \isc) \text{ for some } \con, \sigma}
  {\jdg{\modid, I}{\tycon\,\kw{(..)}}{(\{\tycon\},\ \Dom\VE \cap \Dom(\VE \of I))}}

Tests (3)

Discussions

Discuss this rule·Search the discussions on GitHub

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