According to David MacQueen in his Reflections on Standard ML report1,
Lexically-scoped infix directives were an ill-advised legacy from Pop-2. They complicate parsing and they do not work well with the module system because infix directives cannot be exported by structures or specified in signatures (and it would not be a good idea to add such a feature).
Now I do agree with him on the claim that private-only scoping for infix[r]
declarations was a bad idea, it renders imported user-defined operators quite useless, but the solution I imagined for this was to actually export those declarations in signatures.. Not to get rid of them altogether.
Out of the languages I know to have fixity declarations (ML and derivatives, Haskell and derivatives, Prolog, ...), I'm interested in whether they document benefits and/or drawbacks to that idea. More generally, a language implementor's established design experience could bring interesting insights to the disadvantages of what seems (from a user perspective) a nice convenience feature.
So my question is, in short, are there citations and/or known issues in literature that support MacQueen's opinions on not exporting fixity?
infixr
and snoc-like onesinfixl
, to allow convenient repeated application. Cons and snoc will bind more tightly than append. If operations form a semiring, then the "multiplication" will bind more tightly than the "addition". Mixing unrelated operators without parentheses is typically avoided to reduce confusion. – Log