Restrictionmodules-header-exposing
In the exposing list of a header, each item is bound by a value declaration or a port declaration of the module’s ; each item is the of a or a of the ; and each item is the of a , never of a . In particular a constructor cannot be exposed by name: an item names a type, and the constructors of a custom type are exposed only by or by (..).
Tests (3)
- elm / HeaderExposesAliasOpenTestA header cannot expose a type alias with `(..)`.
- elm / HeaderExposesConstructorByNameTestA header cannot expose a constructor by name.
- elm / HeaderExposesUndeclaredValueTestA header exposes only values the module declares.
In Lean
This restriction is decided on the syntax tree, as the book states it, by Src.HeaderExposing (StandardElmMech/Src/Restrictions.lean, line 262), whose decider the kernel runs; each written test program has a theorem that it meets the restrictions, or that it breaks this one. Broken by: HeaderExposesAliasOpenTest, HeaderExposesConstructorByNameTest, HeaderExposesUndeclaredValueTest.
Discussions
Discuss this restriction·Search the discussions on GitHub
Discussions are on GitHub; one about this restriction has [res:modules-header-exposing] 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.