Oh, I drew a conclusion too early when fiddling with a hypothetical Generic1 instance. I now think it's not possible to define an instance with the current kit.
I figured out that this compiles:
data HKD (f :: Type -> Type) = Foo (F1 Int f) (F1 Double f)
| Bar (F1 Bool f)
deriving Generic1
newtype F1 a f = F1 { unF1 :: f a }
Problem solved, thanks!
Would it be a good idea to add F1 to GHC.Generics? Omitting metadata, it'd derive something like
instance Generic1 HKD where
type Rep1 HKD = F1 Int :*: F1 Double :+: F1 Bool
from1 (Foo a b) = L1 (F1 a :*: F1 b)
from1 (Bar c) = R1 (F1 c)
to1 (L1 (F1 a :*: F1 b)) = Foo a b
to1 (R1 (F1 c)) = Bar c
I suppose it doesn't affect existing Generic1 instances and uses, so I don't expect breakages by adding this
...