id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,os,architecture,failure,difficulty,testcase,blockedby,blocking,related
5936,Support for data families in generics,reinerp,dreixel,"Currently {{{DeriveGeneric}}} doesn't handle data families correctly, so that the following module

{{{
{-# LANGUAGE TypeFamilies, DeriveGeneric #-}
module FamilyDerive where
import GHC.Generics

data family F a
data instance F Int = FInt deriving Generic
}}}

fails to compile, with error

{{{
/tmp/FamilyDerive.hs:6:15:
    Couldn't match type `Rep (F Int)' with `M1 t0 t1 (M1 t2 t3 U1)'
    The type variables `t0', `t1', `t2', `t3' are ambiguous
    Possible fix: add a type signature that fixes these type variable(s)
    Expected type: Rep (F Int) x
      Actual type: M1 t0 t1 (M1 t2 t3 U1) x
    In the pattern: M1 (M1 U1)
    In an equation for `to': to (M1 (M1 U1)) = FInt
    In the instance declaration for `Generic (F Int)'
}}}

It turns out to require only small changes to GHC to handle data families. I've attached patches.
",feature request,closed,normal,7.6.1,Compiler,7.4.1,fixed,,patrick@… bgamari@…,Unknown/Multiple,Unknown/Multiple,None/Unknown,Unknown,"generics/GEq1, generics/GenCanDoRep0",,,
