Deriving `Functor` complains about existential type
When deriving a functor with !DataKinds enabled
{-# LANGUAGE DataKinds, DeriveFunctor, FlexibleInstances, GADTs, KindSignatures, StandaloneDeriving #-}
data {- kind -} Nat = Z | S Nat
data NonStandard :: Nat -> * -> * where
Standard :: a -> NonStandard (S n) a
Non :: NonStandard n a -> a -> NonStandard (S n) a
deriving instance Show a => Show (NonStandard n a)
deriving instance Functor (NonStandard n)
I get following error message
NonStandard.hs:10:1:
Can't make a derived instance of ‛Functor (NonStandard n)’:
Constructor ‛Standard’ must not have existential arguments
In the stand-alone deriving instance for ‛Functor (NonStandard n)’
But the Standard
constructor is not at all existential in the last type argument!
Trac metadata
Trac field | Value |
---|---|
Version | 7.7 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |