
5 Oct
2012
5 Oct
'12
7:22 a.m.
* Johannes Waldmann
I was really surprised at the following:
*Main> 1 + 2 * 3 7
*Main> ( \ (+) (*) -> 1 + 2 * 3 ) (+) (*) 9
because I was somehow assuming that either
a) the Prelude fixities of the operators are kept b) or they are undefined, so the parser rejects.
but the Haskell standard says "Any operator lacking a fixity declaration is assumed to be infixl 9". This really should be "infix 9"?
This behaviour is really handy when you use functions as operators (using backticks notation). They typically lack infix annotations, but having to put parentheses would be very annoying. Roman