Panic when deriving Applicative instance through transformer
I'm not sure if code below is valid, but panic is wrong anyway.
{-# Language TypeFamilies, StandaloneDeriving, GeneralizedNewtypeDeriving, UndecidableInstances #-}
module Example where
newtype N p m a = N (((CT p) m) a)
deriving instance (CT p ~ f, Functor (f m)) => Functor (N p m)
deriving instance (CT p ~ f, Applicative (f m)) => Applicative (N p m) -- panic when this line added
class C p where
type CT p :: (* -> *) -> * -> *
Compiler output for 8.0.1 and 8.0.2 is slightly different:
test.hs:6:1: error:ghc: panic! (the 'impossible' happened)
(GHC version 8.0.1 for x86_64-unknown-linux):
No skolem info: f1_auk[sk]
test.hs:6:1: error:ghc: panic! (the 'impossible' happened)
(GHC version 8.0.2 for x86_64-unknown-linux):
No skolem info: f1_aun[sk]
If I try to derive only Functor instance, code compiles just fine.
Trac metadata
Trac field | Value |
---|---|
Version | 8.0.2 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |