The problem was that (* -> *, *)
or, equivalently, (Type -> Type, Type)
is a kind-level tuple, and one must enable the DataKinds
and PolyKinds
extensions in order to handle it. (I'm not completely sure why PolyKinds
is needed though; maybe it's to allow more general kind inference.)
With datatypes having complex kinds, it's often a good idea to enable StandaloneKindSignatures
and give the kind signature explicitly:
import Data.Kind
type ControlFlowCMD :: (Type -> Type, Type) -> Type -> Type
newtype ControlFlowCMD fs a = ...
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…