Elm Exactly

Restrictionmodules-header-exposing

Stated in Section 3.7 Syntactic Restrictions.

In the exposing list of a header, each item var\var is bound by a value declaration or a port declaration of the module’s topdec\topdec; each item tycon\tycon is the tycon\tycon of a datbind\datbind or a typbind\typbind of the topdec\topdec; and each item tycon (..)\tycon\,\kw{(..)} is the tycon\tycon of a datbind\datbind, never of a typbind\typbind. In particular a constructor cannot be exposed by name: an item tycon\tycon names a type, and the constructors of a custom type are exposed only by tycon (..)\tycon\,\kw{(..)} or by (..).

Read it in its chapter·Permanent address: /standard/restrictions/modules-header-exposing

Tests (3)

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.