[GHC] #15551: TH-reified type classes have redundant tyvars/class constraints on each method

#15551: TH-reified type classes have redundant tyvars/class constraints on each method -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.8.1 Component: Template | Version: 8.4.3 Haskell | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- If you try to reify a type class in Template Haskell, as in the following example: {{{#!hs {-# LANGUAGE TemplateHaskell #-} module Bug where import Language.Haskell.TH class C a where method :: a $(pure []) main :: IO () main = putStrLn $(reify ''C >>= stringE . pprint) }}} You'll discover something strange: {{{ $ /opt/ghc/8.4.3/bin/runghc Bug.hs class Bug.C (a_0 :: *) where Bug.method :: forall (a_0 :: *) . Bug.C a_0 => a_0 }}} Notice how `method` has a completely redundant `forall (a_0 :: *) . Bug.C a_0 =>`! I find this very strange, and would have expected to simply see `Bug.method :: a_0` instead. Currently, I have to work around this oddity by manually stripping off the `forall (a_0 :: *) . Bug.C a_0 =>` myself, but it would be nice if I didn't have to do so. Does this proposal sound reasonable? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15551 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15551: TH-reified type classes have redundant tyvars/class constraints on each method -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: 8.8.1 Component: Template Haskell | Version: 8.4.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5088 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => patch * differential: => Phab:D5088 Comment: I decided to be bold and just fix this. See Phab:D5088. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15551#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15551: TH-reified type classes have redundant tyvars/class constraints on each
method
-------------------------------------+-------------------------------------
Reporter: RyanGlScott | Owner: (none)
Type: bug | Status: patch
Priority: normal | Milestone: 8.8.1
Component: Template Haskell | Version: 8.4.3
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D5088
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Krzysztof Gogolewski

#15551: TH-reified type classes have redundant tyvars/class constraints on each method -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: merge Priority: normal | Milestone: 8.6.1 Component: Template Haskell | Version: 8.4.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5088 Wiki Page: | -------------------------------------+------------------------------------- Changes (by monoidal): * status: patch => merge * milestone: 8.8.1 => 8.6.1 Comment: If it's not too late, this can be merged to 8.6. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15551#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15551: TH-reified type classes have redundant tyvars/class constraints on each method -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.8.1 Component: Template Haskell | Version: 8.4.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5088 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: merge => closed * resolution: => fixed * milestone: 8.6.1 => 8.8.1 Comment: I'm going to request that this //not// be merged to GHC 8.6.1, since it has the potential to break code which assumes the existence of these redundant tyvars/class constraints when reified. (I'll update the Migration Guide for 8.8 to address this.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15551#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15551: TH-reified type classes have redundant tyvars/class constraints on each method -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.8.1 Component: Template Haskell | Version: 8.4.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5088 Wiki Page: | -------------------------------------+------------------------------------- Comment (by monoidal): I'm sorry, I updated the wrong ticket. I agree. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15551#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC