[GHC] #10734: pprint of ‘let’ inside ‘do’ prints invalid Haskell

#10734: pprint of ‘let’ inside ‘do’ prints invalid Haskell -------------------------------------+------------------------------------- Reporter: Fuuzetsu | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Template | Version: 7.10.2 Haskell | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | -------------------------------------+------------------------------------- On GHC 7.10.1 {{{#!hs Prelude Language.Haskell.TH Language.Haskell.TH.Ppr> pprint <$> runQ [| do { let { x = 5 }; return x; } |] "do {let x_0 = 5; GHC.Base.return x_0}" }}} The let binding inside the resulting {{{do}}} should be inside curly braces too -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10734 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10734: pprint of ‘let’ inside ‘do’ prints invalid Haskell -------------------------------------+------------------------------------- Reporter: Fuuzetsu | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Template Haskell | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by Fuuzetsu): Also a problem on 7.10.2 The `Ppr` instance for `LetS` constructor is just not good enough. {{{#!hs Prelude Language.Haskell.TH.Ppr Language.Haskell.TH> pprint <$> runQ [| do { let { x = 5; y = 3 }; return x; } |] "do {let x_0 = 5\n y_1 = 3;\n GHC.Base.return x_0}" }}} Worst thing is that there is no easy way to override this… -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10734#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10734: pprint of ‘let’ inside ‘do’ prints invalid Haskell -------------------------------------+------------------------------------- Reporter: Fuuzetsu | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Template Haskell | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by Fuuzetsu): One last comment in case someone else hits it. You can workaround with {{{#!hs Prelude Language.Haskell.TH Language.Haskell.TH.Ppr> pprint <$> runQ [| do { x <- return 5; return x; } |] "do {x_0 <- GHC.Base.return 5; GHC.Base.return x_0}" }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10734#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10734: pprint of ‘let’ inside ‘do’ prints invalid Haskell -------------------------------------+------------------------------------- Reporter: Fuuzetsu | Owner: johnleo Type: bug | Status: new Priority: normal | Milestone: Component: Template Haskell | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by johnleo): * owner: => johnleo -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10734#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10734: pprint of ‘let’ inside ‘do’ prints invalid Haskell -------------------------------------+------------------------------------- Reporter: Fuuzetsu | Owner: johnleo Type: bug | Status: new Priority: normal | Milestone: Component: Template Haskell | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: th/T10734.hs Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by johnleo): * testcase: => th/T10734.hs -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10734#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10734: pprint of ‘let’ inside ‘do’ prints invalid Haskell
-------------------------------------+-------------------------------------
Reporter: Fuuzetsu | Owner: johnleo
Type: bug | Status: new
Priority: normal | Milestone:
Component: Template Haskell | Version: 7.10.2
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case: th/T10734.hs
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Richard Eisenberg

#10734: pprint of ‘let’ inside ‘do’ prints invalid Haskell -------------------------------------+------------------------------------- Reporter: Fuuzetsu | Owner: johnleo Type: bug | Status: closed Priority: normal | Milestone: Component: Template Haskell | Version: 7.10.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: th/T10734.hs Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by goldfire): * status: new => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10734#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10734: pprint of ‘let’ inside ‘do’ prints invalid Haskell
-------------------------------------+-------------------------------------
Reporter: Fuuzetsu | Owner: johnleo
Type: bug | Status: closed
Priority: normal | Milestone: 8.0.1
Component: Template Haskell | Version: 7.10.2
Resolution: fixed | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case: th/T10734.hs
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari
participants (1)
-
GHC