X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypes%2FCoercion.lhs;h=ff49a6ef2b3ee5262face93ed9a8838377dcd640;hb=27897431cf24d4bde04b15947440c7205f2d703c;hp=d715016352cb4b2da0074a5890b79a9a5f192fc8;hpb=909d2dd885f5eebaf7c12cf15d5ac153d646566e;p=ghc-hetmet.git diff --git a/compiler/types/Coercion.lhs b/compiler/types/Coercion.lhs index d715016..ff49a6e 100644 --- a/compiler/types/Coercion.lhs +++ b/compiler/types/Coercion.lhs @@ -38,9 +38,9 @@ import Type ( Type, Kind, PredType, substTyWith, mkAppTy, mkForAllTy, mkFunTy, splitAppTy_maybe, splitForAllTy_maybe, coreView, kindView, mkTyConApp, isCoercionKind, isEqPred, mkAppTys, coreEqType, splitAppTys, isTyVarTy, splitTyConApp_maybe, - tyVarsOfType + tyVarsOfType, mkTyVarTys ) -import TyCon ( TyCon, tyConArity, mkCoercionTyCon, isNewTyCon, +import TyCon ( TyCon, tyConArity, mkCoercionTyCon, isClosedNewTyCon, newTyConRhs, newTyConCo, isCoercionTyCon, isCoercionTyCon_maybe ) import Var ( Var, TyVar, isTyVar, tyVarKind ) @@ -340,10 +340,10 @@ mkDataInstCoercion name tvs family instTys rep_tycon where coArity = length tvs - rule args = (substTyWith tvs tys $ -- with sigma = [tys/tvs], - TyConApp family instTys, -- sigma (F ts) - TyConApp rep_tycon instTys, -- :=: R tys - rest) -- surplus arguments + rule args = (substTyWith tvs tys $ -- with sigma = [tys/tvs], + TyConApp family instTys, -- sigma (F ts) + TyConApp rep_tycon tys, -- :=: R tys + rest) -- surplus arguments where tys = take coArity args rest = drop coArity args @@ -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