Generalized newtype deriving fails for newtypes that are type family instances
With FlexibleContexts, FlexibleInstances, GeneralizedNewtypeDeriving, StandaloneDeriving, & TypeFamilies the following code produces an "impossible" error (genDerivBinds: bad derived class):
data family F a
newtype instance F [a] = Maybe a
class C a where data D a
deriving instance C (Maybe a) => C (F [a])
Whereas I expected something like this (which works):
instance C (Maybe a) => C (F [a]) where newtype D (F [a]) = SomeCon (D (Maybe a))
Trac metadata
Trac field | Value |
---|---|
Version | 6.12.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |