Rule 55sm-item-opentype
Exposing Items
(55)
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 , 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)
- elm / ImportAliasOpenItemTestAn import cannot name a type alias with `(..)`.
- elm / ImportClosedTypeOpenItemTest`import M exposing (T(..))` of a type that `M` exposes closed imports the type and no constructors.
- elm / ImportExposingItemsTestAn import's exposing list brings exactly its items into scope, with what the imported module's header exposes.
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.