Restrictioncore-operator-chain
If and () of a chain have equal precedence and no operator of lower precedence stands between them, then either both associate to the left and the chain groups to the left, or both associate to the right and it groups to the right; otherwise the chain is not a phrase of the language.
Tests (5)
- elm / InfixMixedAssocComposeTest`f << g >> h` is not a phrase: `<<` and `>>` have equal precedence and associate in opposite ways.
- elm / InfixMixedAssocPipesTest`a |> f <| b` is not a phrase: `|>` and `<|` have equal precedence and associate in opposite ways.
- elm / InfixNonAssocCompareTest`a < b == c` is not a phrase: `<` and `==` have equal precedence and associate neither way.
- elm / InfixNonAssocEqTwiceTest`a == b == c` is not a phrase: `==` associates neither way.
- elm / InfixNonAssocSeparatedLegalTestTwo non-associative operators of equal precedence may share a chain when an operator of lower precedence stands between them.
Discussions
Discuss this restriction·Search the discussions on GitHub
Discussions are on GitHub; one about this restriction has [res:core-operator-chain] 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.