[GHC] #10050: template haskell Ppr missing parentheses for SigT

#10050: template haskell Ppr missing parentheses for SigT -------------------------------------+------------------------------------- Reporter: aavogt | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.4 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Blocked By: Test Case: | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- {{{#!hs ppr (SigE (VarE (mkName "a")) (SigT (VarT (mkName "x")) (VarT (mkName "k")))) }}} prints as "a :: x :: k". Ghc can't parse that, so I think it should be printed as "a :: (x :: k)" -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10050 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10050: template haskell Ppr missing parentheses for SigT -------------------------------------+------------------------------------- Reporter: aavogt | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.4 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by adamse): The printing of `SigE` happens in [https://github.com/ghc/ghc/blob/master/libraries/template- haskell/Language/Haskell/TH/Ppr.hs#L172] and `SigT` happens in [https://github.com/ghc/ghc/blob/master/libraries /template-haskell/Language/Haskell/TH/Ppr.hs#L507]. If it is always correct to put parens around a `Type :: Kind` signature the fix could go in the latter place otherwise `pprExp` of `SigE` could inspect the second argument to `SigE` to see if it is a `SigT` and only then put parens around it. What would be the correct solution? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10050#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10050: template haskell Ppr missing parentheses for SigT
-------------------------------------+-------------------------------------
Reporter: aavogt | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.8.4
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: None/Unknown | Unknown/Multiple
Blocked By: | Test Case:
Related Tickets: | Blocking:
| Differential Revisions:
-------------------------------------+-------------------------------------
Comment (by Simon Peyton Jones

#10050: template haskell Ppr missing parentheses for SigT -------------------------------------+------------------------------------- Reporter: aavogt | Owner: Type: bug | Status: merge Priority: normal | Milestone: Component: Compiler | Version: 7.8.4 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => merge Comment: Thanks for reporting this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10050#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10050: template haskell Ppr missing parentheses for SigT -------------------------------------+------------------------------------- Reporter: aavogt | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.8.4 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thoughtpolice): * status: merge => closed * resolution: => fixed Comment: Merged to `ghc-7.10` (via b5f465e247c37e905b25057aa9072c8861058381). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10050#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10050: template haskell Ppr missing parentheses for SigT -------------------------------------+------------------------------------- Reporter: aavogt | Owner: Type: bug | Status: closed Priority: normal | Milestone: 7.10.1 Component: Compiler | Version: 7.8.4 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thoughtpolice): * milestone: => 7.10.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10050#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC