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

GHC ghc-devs at haskell.org
Mon May 22 22:16:29 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 simonpj):

 Oh my mistake.  I thought `instance Functor (Test ListExtension)` involved
 a type family; but it doesn't.  Neither `Test` nor `ListExtension` is a
 type family.  My mistake.

 Then indeed the error message makes more sense.  But not total sense.  If
 you reduce the arity of `ExtensionType1 the `deriving` clause works fine
 (as it should)
 {{{
 type family ExtensionType ext :: * -> *
 type instance ExtensionType ListExtension  = []
 }}}
 So it's not that it must be a data type; it can be a saturated type-family
 application.

 But I now think this is a non-bug; `deriving` is working right, and
 reducing the arity of `ExtensionType` is the right solution.

 But

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


More information about the ghc-tickets mailing list