[GHC] #5939: Standalone deriving Generic on type with instantiated arguments

GHC ghc-devs at haskell.org
Sun Apr 10 21:39:31 UTC 2016


#5939: Standalone deriving Generic on type with instantiated arguments
-------------------------------------+-------------------------------------
        Reporter:  dreixel           |                Owner:  dreixel
            Type:  bug               |               Status:  closed
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.5
      Resolution:  fixed             |             Keywords:  Generics
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
                                     |  GenCannotDoRep0
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Ben Gamari <ben@…>):

 In [changeset:"7443e5c8dae24b83f5f4975c7accce02b819029c/ghc"
 7443e5c8/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="7443e5c8dae24b83f5f4975c7accce02b819029c"
 Remove the instantiation check when deriving Generic(1)

 Previously, deriving `Generic(1)` bailed out when attempting to
 instantiate visible type parameters (#5939), but this instantiation
 check was quite fragile and doesn't interact well with `-XTypeInType`.
 It has been decided that `Generic(1)` shouldn't be subjected to this
 check anyway, so it has been removed, and `gen_Generic_binds`'s
 machinery has been updated to substitute the type variables in a
 generated `Rep`/`Rep1` instance with the user-supplied type arguments.

 In addition, this also refactors `Condition` in `TcDeriv` a bit. Namely,
 since we no longer need `tc_args` to check any conditions, the `[Type]`
 component of `Condition` has been removed.

 Fixes #11732.

 Test Plan: ./validate

 Reviewers: goldfire, kosmikus, simonpj, bgamari, austin

 Reviewed By: simonpj, bgamari

 Subscribers: thomie

 Differential Revision: https://phabricator.haskell.org/D2061

 GHC Trac Issues: #5939, #11732
 }}}

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


More information about the ghc-tickets mailing list