id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,os,architecture,failure,difficulty,testcase,blockedby,blocking,related
5508,Template Haskell -ddump-splices lambda pretty printing bug,mgsloan1,,"Parentheses are not placed around lambda expressions when dumping template haskell splices.

One strange thing about this bug is that it only occurs when using ""-ddump-splices"", and not when using Language.Haskell.TH.Ppr.pprint

{{{
x = mkName ""x""

thb = QuasiQuoter (const [| $(return . LamE [VarP x] $ VarE x) . id |])
                  undefined undefined undefined 
}}}

{{{
ghci THPrettyBug.hs -ddump-splices -XQuasiQuotes
GHCi, version 7.2.1: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package ffi-1.0 ... linking ... done.
[1 of 1] Compiling Main             ( THPrettyBug.hs, interpreted )
Ok, modules loaded: Main.
*Main> [thb| |]
Loading package pretty-1.1.0.0 ... linking ... done.
Loading package array-0.3.0.3 ... linking ... done.
Loading package containers-0.4.1.0 ... linking ... done.
Loading package template-haskell ... linking ... done.
<interactive>:0:1-8: Splicing expression
    "" "" ======> (\ x -> x . id)

<interactive>:0:1:
    No instance for (Show (c0 -> c0))
      arising from a use of `print'
    Possible fix: add an instance declaration for (Show (c0 -> c0))
    In a stmt of an interactive GHCi command: print it
}}}",bug,closed,normal,,Template Haskell,7.2.1,fixed,,,Unknown/Multiple,Unknown/Multiple,Incorrect warning at compile-time,,th/T5508,,,
