-ddump-parsed and infix operators

Simon Peyton-Jones 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
precedence.

So it's not a bug.  Just something you need to know about -ddump-parsed!

Simon

| -----Original Message-----
| From: glasgow-haskell-users-bounces at haskell.org
[mailto:glasgow-haskell-users-
| 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.[]
| 
| 
| [1,2,3]
| %%%%%
| 
| 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
way?)
| 
| However, the output above is a bit puzzling to me. Should I report
this
| as a minor bug or is this the intended output?
| 
| Thanks to your attention,
| Zun.


More information about the Glasgow-haskell-users mailing list