wondering about -ddump-parsed, rn

Isaac Dupree isaacdupree at charter.net
Wed Aug 8 19:44:19 EDT 2007


Is ghc -ddump-parsed supposed to give parse-syntactically valid Haskell? 
It nearly does - the only way I've seen it not do so is infix 
type-signatures and some infix definitions.  Answer: no, look at what it 
does to the operators with fixities.  But, -ddump-rn seems better...

file:

(@@@) :: a
a @@@ b = a + b : a + b

==================== Parser ====================
@@@ :: a
@@@ a b = ((a + b) : a) + b

==================== Renamer ====================
@@@ :: a
@@@ a b = (a + b) : (a + b)


It would be interesting if that was a source-to-source transformation on 
Haskell: a way to delete all the comments and formatting of the original 
file.  Putting parentheses around infix used as prefix would be nice. 
Of course... the renamer output depends on other modules, and must for 
the precise reason of imported fixity declarations!  GHC isn't trying to 
do this so I really have no reason to ask it to :)

P.S. this (-ddump-) is a nice way to see how some stages of GHC's 
processing are done, to get to know them a little, I think, after also 
looking through some code and Commentary

Isaac


More information about the Glasgow-haskell-users mailing list