[GHC] #11732: Deriving Generic1 interacts poorly with TypeInType

GHC ghc-devs at haskell.org
Mon Mar 21 16:22:49 UTC 2016


#11732: Deriving Generic1 interacts poorly with TypeInType
-------------------------------------+-------------------------------------
        Reporter:  goldfire          |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.1
      Resolution:                    |             Keywords:  TypeInType,
                                     |  Generics
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by goldfire):

 I claim that

 {{{
 data Proxy k (a :: k) = ProxyCon deriving Generic1
 }}}

 should fail outright. I don't think GHC should be in the business of
 inferring values for visible parameters like `k`, even when it could.
 Instead, it should be this:

 {{{
 deriving instance Generic1 (Proxy *)
 }}}

 Note that this applies to `Functor` as much as it does to `Generic1`.

 As for the `partitionInvisibles` piece: yes, that is all suspicious. I
 conjecture that we should never call `partitionInvisibles` on a data
 ''instance'' tycon, but only on the data ''family'' tycon. Perhaps we need
 to teach `partitionInvisibles` how to work on data instances. But not
 today, I'm afraid.

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


More information about the ghc-tickets mailing list