[Haskell-cafe] referential transparency? (for fixity of local operators)

Johannes Waldmann waldmann at imn.htwk-leipzig.de
Fri Oct 5 13:11:48 CEST 2012


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"?






More information about the Haskell-Cafe mailing list