28 Mar
2006
28 Mar
'06
11:28 p.m.
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