infix operator parsing problem
Duncan Coutts
duncan.coutts@worcester.oxford.ac.uk
Sat, 23 Feb 2002 15:25:47 +0000
I have the following fragment in a module that is accepted by ghc but not by
hugs. It seems like it should be ok to me since
infixr 9 .
infixr 0 $>
Here's the offending line
tag = (singleton . tagWith pos $>)
It works if I bracket it like this:
tag = ((singleton . tagWith pos) $>)
Here's a self contained example:
module Foo where
infixr 5 $$
infixr 4 $$$
foo = (id $$ id $$$)
($$) = id
($$$) = id
ghc acepts this, so long as $$$ has lower precedence than $$, otherwise it
complains:
Foo.hs:6:
The operator `$$$' [infixr 5] of a section
must have lower precedence than the operand `($$)' [infixr 4]
in the section: `((id $$ id) $$$)'
Duncan