ghc 7.4.1のDataKindsを介してプロモートするデータ型と、型固有の操作を実行するために使用する特定の型クラスがあります。
data Type = TInt32 | TInt64 | TInt16
class TypeTraits a where
...
次に、次のようにプロモートされた型の型クラスインスタンスを作成しようとします。
instance TypeTraits TInt32 where
...
次のタイプのエラーが発生します。
Kind mis-match
The first argument of `TypeTraits' should have kind `*',
but `TInt32' has kind `Type'
In the instance declaration for `TypeTraits TInt32'
'a'の種類を指定してこれを修正しようとしています:
class TypeTraits (a :: Type) where
...
Kind mis-match
Expected kind `ArgKind', but `a' has kind `Type'
In the type `a -> String'
In the class declaration for `TypeTraits'