Commit 204e70a4 authored by chak@cse.unsw.edu.au.'s avatar chak@cse.unsw.edu.au.
Browse files

clean up Coercion kinding functions, rename coercionKindTyConApp

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
parent 58d200ac
......@@ -37,7 +37,7 @@ import Type ( Type, tyVarsOfType, coreEqType,
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 )
......@@ -431,7 +431,7 @@ checkKinds tyvar arg_ty
(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}
......
......@@ -71,7 +71,7 @@ import Type ( Type, mkFunTy, mkForAllTy, splitFunTy_maybe,
)
import Coercion ( Coercion, mkTransCoercion, coercionKind,
splitNewTypeRepCo_maybe, mkSymCoercion, mkLeftCoercion,
mkRightCoercion, decomposeCo, coercionKindTyConApp,
mkRightCoercion, decomposeCo, coercionKindPredTy,
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
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}
......
......@@ -40,7 +40,7 @@ import IdInfo ( cprInfo, ppCprInfo, strictnessInfo, ppStrictnessInfo )
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
......@@ -128,7 +128,7 @@ ppr_expr add_par (Cast expr co)
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 _ _)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment