-ddump-parsed and infix operators
simonpj at microsoft.com
Wed Dec 15 03:57:10 EST 2004
You're right: they are passed left-associatively, and fixed up later.
That way the parser does not need to know about associativity and
So it's not a bug. Just something you need to know about -ddump-parsed!
| -----Original Message-----
| From: glasgow-haskell-users-bounces at haskell.org
| bounces at haskell.org] On Behalf Of Roberto Zunino
| Sent: 14 December 2004 19:37
| To: Glasgow-haskell-users at haskell.org
| Subject: -ddump-parsed and infix operators
| I noticed that GHC 6.2.2 always parse infix operators as they were
| left-associative. For example:
| Prelude> :info :
| -- : is a data constructor
| infixr 5 :
| (:) :: forall a. a -> [a] -> [a]
| Prelude> 1:2:3:
| ==================== Parser ====================
| ((1 GHC.Base.: 2) GHC.Base.: 3) GHC.Base.: GHC.Base.
| I suppose that the parse tree is then "fixed" in a later stage.
| (Or maybe the parse tree is fine but it gets unparsed in the wrong
| However, the output above is a bit puzzling to me. Should I report
| as a minor bug or is this the intended output?
| Thanks to your attention,
More information about the Glasgow-haskell-users