X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Ftypes%2FType.lhs;h=a7aeeec5043cb8f2579bfab962afec6ab26e9186;hp=b7f521a15d12e245bf5384bf21667c1547dd1d9c;hb=e8a591c1a3dbdeccec2dd2aacccd7435004b0d51;hpb=6fcf90065dc4e75b7dc6bbf238a9891a71ae5a86 diff --git a/compiler/types/Type.lhs b/compiler/types/Type.lhs index b7f521a..a7aeeec 100644 --- a/compiler/types/Type.lhs +++ b/compiler/types/Type.lhs @@ -12,7 +12,7 @@ module Type ( -- Kinds Kind, SimpleKind, KindVar, - kindFunResult, splitKindFunTys, + kindFunResult, splitKindFunTys, splitKindFunTysN, liftedTypeKindTyCon, openTypeKindTyCon, unliftedTypeKindTyCon, argTypeKindTyCon, ubxTupleKindTyCon, @@ -106,7 +106,7 @@ import TypeRep -- friends: import Var ( Var, TyVar, tyVarKind, tyVarName, - setTyVarName, setTyVarKind, mkWildTyVar ) + setTyVarName, setTyVarKind, mkWildCoVar ) import VarEnv import VarSet @@ -307,7 +307,7 @@ splitAppTys ty = split ty ty [] \begin{code} mkFunTy :: Type -> Type -> Type -mkFunTy (PredTy (EqPred ty1 ty2)) res = mkForAllTy (mkWildTyVar (PredTy (EqPred ty1 ty2))) res +mkFunTy (PredTy (EqPred ty1 ty2)) res = mkForAllTy (mkWildCoVar (PredTy (EqPred ty1 ty2))) res mkFunTy arg res = FunTy arg res mkFunTys :: [Type] -> Type -> Type @@ -1029,6 +1029,7 @@ cmpPredX env (IParam n1 ty1) (IParam n2 ty2) = (n1 `compare` n2) `thenCmp` cmpTy cmpPredX env (ClassP c1 tys1) (ClassP c2 tys2) = (c1 `compare` c2) `thenCmp` cmpTypesX env tys1 tys2 cmpPredX env (IParam _ _) (ClassP _ _) = LT cmpPredX env (ClassP _ _) (IParam _ _) = GT +cmpPredX env (EqPred ty1 ty2) (EqPred ty1' ty2') = (cmpTypeX env ty1 ty1') `thenCmp` (cmpTypeX env ty2 ty2') \end{code} PredTypes are used as a FM key in TcSimplify, @@ -1370,6 +1371,9 @@ kindFunResult k = funResultTy k splitKindFunTys :: Kind -> ([Kind],Kind) splitKindFunTys k = splitFunTys k +splitKindFunTysN :: Int -> Kind -> ([Kind],Kind) +splitKindFunTysN k = splitFunTysN k + isUbxTupleKind, isOpenTypeKind, isArgTypeKind, isUnliftedTypeKind :: Kind -> Bool isOpenTypeKindCon tc = tyConUnique tc == openTypeKindTyConKey