Elm Exactly

Rule 47sm-header

HeadersE⊢header⇒(modid,I)\jdg{E}{\header}{(\modid, I)}
I=Expose(E,explist)E⊢⟨port⟩ module modid exposing explist⇒(modid,I)\frac{\begin{array}{c}I = \Expose(E, \explist)\end{array}}{\begin{array}{c}\jdg{E}{\opt{\kw{port}}\ \kw{module}\ \modid\ \kw{exposing}\ \explist}{(\modid, I)}\end{array}}
(47)
Read it in its chapter·Permanent address: /standard/rules/sm-header

Comments

Whether a module is a port module matters only to the syntactic restrictions, which allow port declarations in it and require at least one. The exposing list of a header elaborates by the operation Expose\Expose of Section 5.2, which the syntactic restrictions make defined; the rules of the groups Exposing Lists and Exposing Items below are for the exposing lists of imports.

TeX source
\defnrule[r:sm-header]
  {I = \Expose(E, \explist)}
  {\jdg{E}{\opt{\kw{port}}\ \kw{module}\ \modid\ \kw{exposing}\ \explist}{(\modid, I)}}

Tests (2)

  • elm / ImportExposingItemsTest
    An import's exposing list brings exactly its items into scope, with what the imported module's header exposes.
  • elm / ImportUnexposedValueTest
    A value its module's header does not expose cannot be used, even qualified.

Discussions

Discuss this rule·Search the discussions on GitHub

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