The Haskell Report

Ch. A. Herrmann herrmann@infosun.fmi.uni-passau.de
Mon, 23 Jul 2001 16:04:15 +0200


Hi Haskellers,

because I recognized that some people are discussing
the Haskell report, I'd like to point out a problem
concerning the operator precedences.

At precedence level 9, there are the left associative
operator (!!) and the right associative operator (.),
but combining both directions doesn't make sense neither for me ..

.. nor for ghci: 
   > gs !! i . f
   > cannot mix `(!!)' [infixl 9] and `(.)' [infixr 9] in the same infix expression
 
It appears sensible for me that (!!) associates to the
left and I suppose that there is a strong requirement
for (.), which is associative anyway (f.g).h = f.(g.h), 
to associate to the right, due to efficiency reasons.
However, what's the problem with introducing a precedence level 10
and move (!!) upto it?

Cheers
Christoph