Renaming in pretty printer

Andy Gill <[email protected]> Tue, 28 Mar 2006 09:58:20 -0800
Newsgroups gmane.comp.lang.haskell.template
Message-ID <[email protected]>
Template Haskell appears to be doing renaming during pretty printing.
Take this example, that both prints the AST directly, as well as  
pretty printing.

*Main> runQ ([| let x = 1 in x |]) >>= \x -> print (pprint x,x)
("let x_0 = 1\n in x_0",LetE [ValD (VarP x_7) (NormalB (LitE  
(IntegerL 1))) []] (VarE x_7))

The var x has name x_7 in the AST, but x_0 in the pretty printed  
version.

Can someone comment on why this is done?

Andy Gill