[GHC] #13154: Standalone-derived anyclass instances aren't as permissive as empty instances

GHC ghc-devs at haskell.org
Tue Feb 20 18:00:02 UTC 2018


#13154: Standalone-derived anyclass instances aren't as permissive as empty
instances
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  RyanGlScott
            Type:  bug               |               Status:  patch
        Priority:  normal            |            Milestone:  8.6.1
       Component:  Compiler (Type    |              Version:  8.1
  checker)                           |
      Resolution:                    |             Keywords:  deriving
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D4337,
       Wiki Page:                    |  Phab:D4370
-------------------------------------+-------------------------------------

Comment (by Ryan Scott <ryan.gl.scott@…>):

 In [changeset:"f4336593a390e6317ac2852d8defb54bfa633d3e/ghc"
 f4336593/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="f4336593a390e6317ac2852d8defb54bfa633d3e"
 Slight refactor of stock deriving internals

 Summary:
 Before, the `hasStockDeriving` function, which determines
 how derived bindings should be generated for stock classes, was
 awkwardly separated from the `checkSideConditions` function, which
 checks invariants of the same classes that `hasStockDeriving` does.
 As a result, there was a fair deal of hoopla needed to actually use
 `hasStockDeriving`.

 But this hoopla really isn't required—we should be using
 `hasStockDeriving` from within `checkSideConditions`, since they're
 looking up information about the same classes! By doing this, we can
 eliminate some kludgy code in the form of `mk_eqn_stock'`, which had
 an unreachable `pprPanic` that was stinking up the place.

 Reviewers: bgamari, dfeuer

 Reviewed By: bgamari

 Subscribers: dfeuer, rwbarton, thomie, carter

 GHC Trac Issues: #13154

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

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


More information about the ghc-tickets mailing list