Elm Exactly

Restrictionmodules-alias-not-recursive

Stated in Section 3.7 Syntactic Restrictions.

No alias may be recursive. For the type-alias bindings of a topdec\topdec, say that tycon\tycon refers to tycon′\tycon' if tycon′\tycon' is declared by a type-alias binding of the topdec\topdec and occurs, unqualified, in the type of the binding of tycon\tycon; this relation has no cycle. The tycon\tycon of a custom type is not related by it, so a cycle through a custom type is not excluded.

Read it in its chapter·Permanent address: /standard/restrictions/modules-alias-not-recursive

Tests (3)

In Lean

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

Discussions

Discuss this restriction·Search the discussions on GitHub

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