2 ms·
The problems I see with infix operators are: - It's not necessarily obvious what is an infix operator - Precedence and associativity I think Haskell has solv
by Dewie 13y ago
The problems I see with infix operators are:
- It's not necessarily obvious what is an infix operator
- Precedence and associativity
I think Haskell has solved the first one: with all non-alphanumeric symbols in expressions being infix operators, and likewise for alphanumeric functions written with backticks.
But precedence and associativity is not obvious, since that is something that you can customize. I think that user-defined infix operators with some severe limits on choosing precedence and associativity is a good compromise (many use backticks on functions in Haskell, and that has a default precedence).