Error message, room for improvement (polykinds)
Something like
-- • No instance for (Show (Compose Proxy Proxy a))
-- arising from the 'deriving' clause of a data type declaration
-- Possible fix:
-- use a standalone 'deriving instance' declaration,
-- so you can specify the instance context yourself
-- • When deriving the instance for (Show (FlipProxy a))
{-# Language DerivingStrategies, GeneralizedNewtypeDeriving, PolyKinds, KindSignatures #-}
import Data.Functor.Compose
import Data.Proxy
import Data.Kind
newtype FlipProxy a = FlipProxy_ (Compose Proxy Proxy a)
deriving newtype
Show
where the solution is to constrain the kind of a
to Type
, it would be nice if GHC could reference kind variables.