Elm Exactly

Restrictionmodules-no-shadowing

Stated in Section 3.7 Syntactic Restrictions.

No variable bound within an expression of a topdec\topdec (a parameter of a lambda, a variable of a pattern, or a variable bound in a let) may be a var\var bound by a value declaration or a port declaration of that topdec\topdec, wherever the declaration stands. This extends to top-level names the restriction on shadowing of Section 2.10. Variables declared by imported modules may be bound again.

Read it in its chapter·Permanent address: /standard/restrictions/modules-no-shadowing

Tests (1)

In Lean

This restriction is decided on the syntax tree, as the book states it, by Src.TopNoShadowing (StandardElmMech/Src/Restrictions.lean, line 281), 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: ShadowingAnArgumentShadowingATopLevelValueTest.

Discussions

Discuss this restriction·Search the discussions on GitHub

Discussions are on GitHub; one about this restriction has [res:modules-no-shadowing] 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.