Restrictionmodules-alias-not-recursive
No alias may be recursive. For the type-alias bindings of a , say that refers to if is declared by a type-alias binding of the and occurs, unqualified, in the type of the binding of ; this relation has no cycle. The of a custom type is not related by it, so a cycle through a custom type is not excluded.
Tests (3)
- elm / AliasProblemExtensibleRecordUnitTupleAndFunctionTestA type alias that refers to itself inside an extensible record is rejected with an ALIAS PROBLEM.
- elm / AliasProblemQualifiedTypeTestA type alias that refers to itself through a qualified type is rejected with an ALIAS PROBLEM.
- elm / AliasProblemRecursiveAliasWithCommentedParensTestA record type alias that refers to itself is rejected with an ALIAS PROBLEM.
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.