Dubious behavior in TH pretty printer

Ian Lynagh igloo at earth.li
Sun Apr 1 12:02:39 EDT 2007


On Sat, Mar 31, 2007 at 01:00:06AM -0700, Stefan O'Rear wrote:
> 
> stefan at stefans:~/daanpp$ ghci -fth
> Prelude> :m + Language.Haskell.TH
> Prelude Language.Haskell.TH> runQ [| (+) 2 2 |] >>= print . ppr
> GHC.Num.+ 2 2
> 
> I am trying to use the Template Haskell AST system for internal
> representation of terms in a derivation library that can output
> Haskell or feed directly into a splice.  This "bug", unfixed, would
> force me to fork the TH pretty printer.  What would people think of a
> patch changing the behavor to "Always produce parsable output"?  (Yes,
> I'm offering to implement it.)

Sounds great - the pretty-printer is intended to print in valid Haskell
syntax.


Thanks
Ian



More information about the Libraries mailing list