The left parameter (f) in f :.: g is not a generic representation, but a plain representation. Only the right parameter is a Generic representation. See example here.
The instance
instance (GShowSingle Identity f, GShowSingle p g)
=> GShowSingle p (f :.: g) where
...
should instead be
instance (Show1 f, GShowSingle p g)
=> GShowSingle p (f :.: g) where
...
similarly to the instance for Rec1 f.
A simple example of this would be trying to derive Show1 for a type equivalent to Compose.
newtype MyCompose f g a = MyCompose (f (g a))
deriving Generic1
deriving Show1 via Generically1 (MyCompose f g)
gives the error
* Could not deduce (Generic.Data.Internal.Show.GShowSingle
Data.Functor.Identity.Identity f)
arising from the 'deriving' clause of a data type
declaration
from the context: Show1 g
The left parameter (
f
) inf :.: g
is not a generic representation, but a plain representation. Only the right parameter is a Generic representation. See example here.The instance
should instead be
similarly to the instance for
Rec1 f
.A simple example of this would be trying to derive
Show1
for a type equivalent toCompose
.gives the error