[GHC] #13731: DeriveFunctor and friends don't understand type families

GHC ghc-devs at haskell.org
Tue May 23 00:12:52 UTC 2017


#13731: DeriveFunctor and friends don't understand type families
-------------------------------------+-------------------------------------
        Reporter:  spacekitteh       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.1-rc2
      Resolution:                    |             Keywords:
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 RyanGlScott):

 > So it's not that it must be a data type; it can be a saturated type-
 family application.

 Am I missing something? In the original example, the type family instance
 is:

 {{{#!hs
 type instance ExtensionType ListExtension a = [a]
 }}}

 And the instance we're deriving is:

 {{{#!hs
 deriving instance Functor (Test ListExtension)
 }}}

 In other words, the field of `Extend` will have type `ExtensionType
 ListExtension a`. This is a fully saturated type family application,
 right? So surely the rule you've proposed doesn't quite capture the
 essence of this problem.

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


More information about the ghc-tickets mailing list