X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Ftypes%2FKind.lhs;h=32a9eac481cceeabeab289fa20747549d9b93f6c;hp=23787d20e2bd81674f5e9f335608a7795323ae36;hb=b2524b3960999fffdb3767900f58825903f6560f;hpb=fdf8656855d26105ff36bdd24d41827b05037b91 diff --git a/compiler/types/Kind.lhs b/compiler/types/Kind.lhs index 23787d2..32a9eac 100644 --- a/compiler/types/Kind.lhs +++ b/compiler/types/Kind.lhs @@ -15,6 +15,7 @@ module Kind ( -- Kind constructors... liftedTypeKindTyCon, openTypeKindTyCon, unliftedTypeKindTyCon, argTypeKindTyCon, ubxTupleKindTyCon, + ecKind, -- Super Kinds tySuperKind, tySuperKindTyCon, @@ -72,8 +73,11 @@ isLiftedTypeKindCon tc = tc `hasKey` liftedTypeKindTyConKey \begin{code} typeKind :: Type -> Kind -typeKind (TyConApp tc tys) - = kindAppResult (tyConKind tc) tys +typeKind _ty@(TyConApp tc tys) + = ASSERT2( not (tc `hasKey` eqPredPrimTyConKey) || length tys == 2, ppr _ty ) + -- Assertion checks for unsaturated application of (~) + -- See Note [The (~) TyCon] in TysPrim + kindAppResult (tyConKind tc) tys typeKind (PredTy pred) = predKind pred typeKind (AppTy fun _) = kindFunResult (typeKind fun) @@ -229,4 +233,6 @@ defaultKind k | isSubOpenTypeKind k = liftedTypeKind | isSubArgTypeKind k = liftedTypeKind | otherwise = k + +ecKind = liftedTypeKind `mkArrowKind` (liftedTypeKind `mkArrowKind` liftedTypeKind) \end{code} \ No newline at end of file