> Hi,
> 
> Is the following legal Haskell?
> 
> > infixr 0 `foo`
> > infixr 0 `bar`
> > 
> > x `foo` y = "foo(" ++ x ++ "," ++ y ++ ")"
> > x `bar` y = "bar(" ++ x ++ "," ++ y ++ ")"
> > dubious a b c = a `foo` b `bar` c
> 
> According to the grammar in the Haskell report, I don't think it is.
> However, ghc-0.24 (ancient, I know) and Hugs 1.3 both accept it without
> complaint.

I haven't my copy of the Haskell report at hand, but I do not see why 
this should not be legal. You are declaring to right associative 
operators foo and bar with the same precedence. Your script wouldn't be 
legal if you had written

infix 0 `foo`
infix 0 `bar`

and this will be rejected by Hugs as it should.

Regards
Wolfgang


----
Wolfgang Lux                     WZH Heidelberg, IBM Germany
Phone: +49-6221-59-4546                Fax: +49-6221-59-3500
Internet: [EMAIL PROTECTED]          Office: mazvm01(lux)




Reply via email to