X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcGadt.lhs;h=e45d6bd53a5c887999e5bdf1ec74220711e4e0ad;hp=9d2658d103fd8b530f3b9edcc8a4306130ca7f88;hb=30c122df62ec75f9ed7f392f24c2925675bf1d06;hpb=17b297d97d327620ed6bfab942f8992b2446f1bf diff --git a/compiler/typecheck/TcGadt.lhs b/compiler/typecheck/TcGadt.lhs index 9d2658d..e45d6bd 100644 --- a/compiler/typecheck/TcGadt.lhs +++ b/compiler/typecheck/TcGadt.lhs @@ -10,11 +10,11 @@ %************************************************************************ \begin{code} -{-# OPTIONS_GHC -w #-} +{-# OPTIONS -w #-} -- The above warning supression flag is a temporary kludge. -- While working on this module you are encouraged to remove it and fix -- any warnings in the module. See --- http://hackage.haskell.org/trac/ghc/wiki/WorkingConventions#Warnings +-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings -- for details module TcGadt ( @@ -39,11 +39,9 @@ import Maybes import Control.Monad import Outputable import TcType - -#ifdef DEBUG import Unique import UniqFM -#endif +import FastString \end{code} @@ -240,11 +238,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 @@ -261,7 +263,6 @@ tryToBind tv_set tv | tv `elemVarSet` tv_set = BindMe %************************************************************************ \begin{code} -#ifdef DEBUG badReftElts :: InternalReft -> [(Unique, (Coercion,Type))] -- Return the BAD elements of the refinement -- Should be empty; used in asserions only @@ -274,7 +275,6 @@ badReftElts env | otherwise = False where (ty1,ty2) = coercionKind co -#endif emptyInternalReft :: InternalReft emptyInternalReft = emptyVarEnv