When enabling PolyKinds
, previously valid type signatures can become invalid.
The following code compiles without PolyKinds
.
{-# LANGUAGE KindSignatures #-}
import GHC.Generics
foo :: Constructor c => t c (f :: * -> *) a -> [Char]
foo = conName
When I enable PolyKinds
it fails to compile.
Kind incompatibility when matching types:
t0 :: * -> (* -> *) -> * -> *
t :: * -> (* -> *) -> k -> *
Expected type: t c f a -> [Char]
Actual type: t0 c f a0 -> [Char]
Relevant bindings include
foo :: t c f a -> [Char] (bound at Gen.hs:8:1)
In the expression: conName
In an equation for ‘foo’: foo = conName
Is there a way to give a type signature for foo
when PolyKinds
is enabled?