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

GHC ghc-devs at haskell.org
Mon Aug 27 13:39:27 UTC 2018


#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 <krz.gogolewski@…>):

 In [changeset:"6e765aebbe0a565f2476b522a49faf8edb9a93ee/ghc" 6e765ae/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="6e765aebbe0a565f2476b522a49faf8edb9a93ee"
 Don't reify redundant class method tyvars/contexts

 Summary:
 Currently, reifying classes produces class methods with
 redundant tyvars and class contexts in their type signatures, such
 as in the following:

 ```lang=haskell
 class C a where
   method :: forall a. C a => a
 ```

 Fixing this is very straightforward: just apply `tcSplitMethodTy` to
 the type of each class method to lop off the redundant parts.

 It's possible that this could break some TH code in the wild that
 assumes the existence of these tyvars and class contexts, so I'll
 advertise this change in the release notes just to be safe.

 Test Plan: make test TEST="TH_reifyDecl1 T9064 T10891 T14888"

 Reviewers: goldfire, bgamari, simonpj

 Reviewed By: simonpj

 Subscribers: simonpj, rwbarton, carter

 GHC Trac Issues: #15551

 Differential Revision: https://phabricator.haskell.org/D5088
 }}}

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


More information about the ghc-tickets mailing list