X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcGadt.lhs;h=48b2b0623cd6455cba11c982be5e06cdc096cdfe;hb=72d043c04c1b0db0896e2c876a1544434f0428ec;hp=b556e89e3273ed15e45c2ad32e4d8479f7979933;hpb=1370a4a360ec154b390c1da21d40e446739b24c8;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcGadt.lhs b/compiler/typecheck/TcGadt.lhs index b556e89..48b2b06 100644 --- a/compiler/typecheck/TcGadt.lhs +++ b/compiler/typecheck/TcGadt.lhs @@ -237,11 +237,15 @@ fixTvCoEnv in_scope env -- then use transitivity with the original coercion ----------------------------- +-- XXX Can we do this more nicely, by exploiting laziness? +-- Or avoid needing it in the first place? fixTvSubstEnv :: InScopeSet -> TvSubstEnv -> TvSubstEnv -fixTvSubstEnv in_scope env - = fixpt +fixTvSubstEnv in_scope env = f env where - fixpt = mapVarEnv (substTy (mkTvSubst in_scope fixpt)) env + f e = let e' = mapUFM (substTy (mkTvSubst in_scope e)) e + in if and $ eltsUFM $ intersectUFM_C tcEqType e e' + then e + else f e' ---------------------------- tryToBind :: TyVarSet -> TyVar -> BindFlag