X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypes%2FCoercion.lhs;h=1dbd7f3eab1a1a6316a9eabee06c192d12a88d17;hb=e56b68fa613a30e8c9287732320087be362345e0;hp=fb91a0de67d9d14d63e8e9d637e903c04e37aaee;hpb=a7a32655a398d0bad611314f0f73c0dcbf2588f4;p=ghc-hetmet.git diff --git a/compiler/types/Coercion.lhs b/compiler/types/Coercion.lhs index fb91a0d..1dbd7f3 100644 --- a/compiler/types/Coercion.lhs +++ b/compiler/types/Coercion.lhs @@ -40,8 +40,8 @@ import Type ( Type, Kind, PredType, substTyWith, mkAppTy, mkForAllTy, coreEqType, splitAppTys, isTyVarTy, splitTyConApp_maybe, tyVarsOfType, mkTyVarTys ) -import TyCon ( TyCon, tyConArity, mkCoercionTyCon, isNewTyCon, - newTyConRhs, newTyConCo, +import TyCon ( TyCon, tyConArity, mkCoercionTyCon, isClosedNewTyCon, + newTyConRhs, newTyConCo_maybe, isCoercionTyCon, isCoercionTyCon_maybe ) import Var ( Var, TyVar, isTyVar, tyVarKind ) import VarSet ( elemVarSet ) @@ -451,7 +451,7 @@ splitNewTypeRepCo_maybe :: Type -> Maybe (Type, Coercion) splitNewTypeRepCo_maybe ty | Just ty' <- coreView ty = splitNewTypeRepCo_maybe ty' splitNewTypeRepCo_maybe (TyConApp tc tys) - | isNewTyCon tc + | isClosedNewTyCon tc = ASSERT( tys `lengthIs` tyConArity tc ) -- splitNewTypeRepCo_maybe only be applied -- to *types* (of kind *) case newTyConRhs tc of @@ -459,6 +459,6 @@ splitNewTypeRepCo_maybe (TyConApp tc tys) ASSERT( length tvs == length tys ) Just (substTyWith tvs tys rep_ty, mkTyConApp co_con tys) where - co_con = maybe (pprPanic "splitNewTypeRepCo_maybe" (ppr tc)) id (newTyConCo tc) + co_con = maybe (pprPanic "splitNewTypeRepCo_maybe" (ppr tc)) id (newTyConCo_maybe tc) splitNewTypeRepCo_maybe other = Nothing \end{code}