[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 <eir@…>): In [changeset:"be8858570274821546ccabf75fe01c3dad80e337/ghc" be885857/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="be8858570274821546ccabf75fe01c3dad80e337" fix #10734 by adding braces to pretty-printing of let inside do Test Plan: validate Reviewers: bgamari, austin, goldfire Reviewed By: goldfire Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1448 GHC Trac Issues: #10734 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10734#comment:5> 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: 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 <ben@…>): In [changeset:"2f9931e3536caa65e40f63f76be5f0d966180411/ghc" 2f9931e3/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="2f9931e3536caa65e40f63f76be5f0d966180411" add Template Haskell regression test for #9022. The bug itself has already been fixed in #10734, so this only adds another regression test (as given in the ticket). Test Plan: ./validate Reviewers: goldfire, austin, thomie, bgamari Reviewed By: bgamari Differential Revision: https://phabricator.haskell.org/D1898 GHC Trac Issues: #9022 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10734#comment:8> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC