在 GHC 8.6.2 上编译这个简短的片段:
{-# LANGUAGE DeriveGeneric, PolyKinds #-}
import GHC.Generics
data Foo f
= FA
| FB (f (Foo f))
deriving (Generic, Generic1)
导致此错误:
Can't make a derived instance of ‘Generic1 Foo’:
Constructor ‘FB’ applies a type to an argument involving the last parameter
but the applied type is not of kind * -> *
Generic
不能为这种类型派生吗?为什么?