clean up Coercion kinding functions, rename coercionKindTyConApp
authorManuel M T Chakravarty <chak@cse.unsw.edu.au>
Wed, 20 Sep 2006 17:47:48 +0000 (17:47 +0000)
committerManuel M T Chakravarty <chak@cse.unsw.edu.au>
Wed, 20 Sep 2006 17:47:48 +0000 (17:47 +0000)
Mon Sep 18 16:46:14 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
  * clean up Coercion kinding functions, rename coercionKindTyConApp
  Sun Aug  6 17:37:06 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
    * clean up Coercion kinding functions, rename coercionKindTyConApp
    Wed Jul 26 10:55:38 EDT 2006  kevind@bu.edu

compiler/coreSyn/CoreLint.lhs
compiler/coreSyn/CoreUtils.lhs
compiler/coreSyn/PprCore.lhs

index 2d5a4fd..354b95c 100644 (file)
@@ -37,7 +37,7 @@ import Type           ( Type, tyVarsOfType, coreEqType,
                          TvSubst, TvSubstEnv, mkTvSubst, setTvSubstEnv, substTy,
                          extendTvSubst, composeTvSubst, substTyVarBndr, isInScope,
                          getTvSubstEnv, getTvInScope, mkTyVarTy )
                          TvSubst, TvSubstEnv, mkTvSubst, setTvSubstEnv, substTy,
                          extendTvSubst, composeTvSubst, substTyVarBndr, isInScope,
                          getTvSubstEnv, getTvInScope, mkTyVarTy )
-import Coercion         ( Coercion, coercionKind, coercionKindTyConApp )
+import Coercion         ( Coercion, coercionKind, coercionKindPredTy )
 import TyCon           ( isPrimTyCon, isNewTyCon )
 import BasicTypes      ( RecFlag(..), Boxity(..), isNonRec )
 import StaticFlags     ( opt_PprStyle_Debug )
 import TyCon           ( isPrimTyCon, isNewTyCon )
 import BasicTypes      ( RecFlag(..), Boxity(..), isNonRec )
 import StaticFlags     ( opt_PprStyle_Debug )
@@ -431,7 +431,7 @@ checkKinds tyvar arg_ty
           (mkKindErrMsg tyvar arg_ty)
   where
     tyvar_kind = tyVarKind tyvar
           (mkKindErrMsg tyvar arg_ty)
   where
     tyvar_kind = tyVarKind tyvar
-    arg_kind | isCoVar tyvar = coercionKindTyConApp arg_ty
+    arg_kind | isCoVar tyvar = coercionKindPredTy arg_ty
             | otherwise     = typeKind arg_ty
 \end{code}
 
             | otherwise     = typeKind arg_ty
 \end{code}
 
index 19a44dc..0077183 100644 (file)
@@ -71,7 +71,7 @@ import Type           ( Type, mkFunTy, mkForAllTy, splitFunTy_maybe,
                        )
 import Coercion         ( Coercion, mkTransCoercion, coercionKind,
                           splitNewTypeRepCo_maybe, mkSymCoercion, mkLeftCoercion,
                        )
 import Coercion         ( Coercion, mkTransCoercion, coercionKind,
                           splitNewTypeRepCo_maybe, mkSymCoercion, mkLeftCoercion,
-                          mkRightCoercion, decomposeCo, coercionKindTyConApp,
+                          mkRightCoercion, decomposeCo, coercionKindPredTy,
                           splitCoercionKind )
 import TyCon           ( tyConArity )
 import TysWiredIn      ( boolTy, trueDataCon, falseDataCon )
                           splitCoercionKind )
 import TyCon           ( tyConArity )
 import TysWiredIn      ( boolTy, trueDataCon, falseDataCon )
@@ -215,7 +215,7 @@ mkCoerce co expr
 --    if to_ty `coreEqType` from_ty
 --    then expr
 --    else 
 --    if to_ty `coreEqType` from_ty
 --    then expr
 --    else 
-        ASSERT2(from_ty `coreEqType` (exprType expr), text "Trying to coerce" <+> text "(" <> ppr expr $$ text "::" <+> ppr (exprType expr) <> text ")" $$ ppr co $$ ppr (coercionKindTyConApp co))
+        ASSERT2(from_ty `coreEqType` (exprType expr), text "Trying to coerce" <+> text "(" <> ppr expr $$ text "::" <+> ppr (exprType expr) <> text ")" $$ ppr co $$ ppr (coercionKindPredTy co))
          (Cast expr co)
 \end{code}
 
          (Cast expr co)
 \end{code}
 
index 36c7df0..2d24aa0 100644 (file)
@@ -40,7 +40,7 @@ import IdInfo         ( cprInfo, ppCprInfo, strictnessInfo, ppStrictnessInfo )
 import DataCon         ( dataConTyCon )
 import TyCon           ( tupleTyConBoxity, isTupleTyCon )
 import Type            ( pprParendType, pprType, pprParendKind )
 import DataCon         ( dataConTyCon )
 import TyCon           ( tupleTyConBoxity, isTupleTyCon )
 import Type            ( pprParendType, pprType, pprParendKind )
-import Coercion         ( coercionKindTyConApp )
+import Coercion         ( coercionKindPredTy )
 import BasicTypes      ( tupleParens, isNoOcc, isAlwaysActive )
 import Util             ( lengthIs )
 import Outputable
 import BasicTypes      ( tupleParens, isNoOcc, isAlwaysActive )
 import Util             ( lengthIs )
 import Outputable
@@ -128,7 +128,7 @@ ppr_expr add_par (Cast expr co)
     sep [pprParendExpr expr, 
         ptext SLIT("`cast`") <+> parens (pprCo co)]
   where
     sep [pprParendExpr expr, 
         ptext SLIT("`cast`") <+> parens (pprCo co)]
   where
-    pprCo co = sep [ppr co, dcolon <+> ppr (coercionKindTyConApp co)]
+    pprCo co = sep [ppr co, dcolon <+> ppr (coercionKindPredTy co)]
         
 
 ppr_expr add_par expr@(Lam _ _)
         
 
 ppr_expr add_par expr@(Lam _ _)