#5508: Template Haskell -ddump-splices lambda pretty printing bug
------------------------------------------------+---------------------------
  Reporter:  mgsloan1                           |          Owner:               
   
      Type:  bug                                |         Status:  closed       
   
  Priority:  normal                             |      Milestone:               
   
 Component:  Template Haskell                   |        Version:  7.2.1        
   
Resolution:  fixed                              |       Keywords:               
   
  Testcase:  th/T5508                           |      Blockedby:               
   
Difficulty:                                     |             Os:  
Unknown/Multiple
  Blocking:                                     |   Architecture:  
Unknown/Multiple
   Failure:  Incorrect warning at compile-time  |  
------------------------------------------------+---------------------------
Changes (by simonpj):

  * status:  new => closed
  * testcase:  => th/T5508
  * resolution:  => fixed


Comment:

 Thanks for reporting this.  Fixed by
 {{{
 commit 3f5c0ad5d33096f4a8cd33217c3be7c32a7943b3
 Author: Simon Peyton Jones <[email protected]>
 Date:   Thu Sep 29 16:57:16 2011 +0100

     Fix parenthesisation in conversion from TH.Exp to HsExpr.HsExpr

     We need to generate enough parens so that -ddump-splices is
     correct Haskell.  There is certainly further to go.

 >---------------------------------------------------------------

  compiler/hsSyn/Convert.lhs |    6 +++++-
  1 files changed, 5 insertions(+), 1 deletions(-)
 }}}
 The new output looks like
 {{{
 T5508.hs:(9,9)-(11,28): Splicing expression
     do { let x = mkName "x"
              v = return (LamE [VarP x] $ VarE x);
          [| $v . id |] }
   ======>
     ((\ x -> x) . id)
 }}}
 Simon

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5508#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to