X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcSMonad.lhs;h=f8b357a8d5a69753f9947dc497f266851dd42bbc;hb=67ed735fab12c12a1d48878d7bda33588c67fb78;hp=4965a931467b089ab304871cc8565197c6606efe;hpb=5db036090509ab6acfd327a8ecb51a4abeed105a;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcSMonad.lhs b/compiler/typecheck/TcSMonad.lhs index 4965a93..f8b357a 100644 --- a/compiler/typecheck/TcSMonad.lhs +++ b/compiler/typecheck/TcSMonad.lhs @@ -31,11 +31,12 @@ module TcSMonad ( getInstEnvs, getFamInstEnvs, -- Getting the environments getTopEnv, getGblEnv, getTcEvBinds, getUntouchablesTcS, - getTcEvBindsBag, getTcSContext, getTcSTyBinds, + getTcEvBindsBag, getTcSContext, getTcSTyBinds, getTcSTyBindsBag, newFlattenSkolemTy, -- Flatten skolems + instDFunTypes, -- Instantiation instDFunConstraints, @@ -63,7 +64,6 @@ module TcSMonad ( import HscTypes import BasicTypes -import Type import Inst import InstEnv @@ -83,6 +83,8 @@ import DynFlags import Coercion import Class import TyCon +import TypeRep + import Name import Var import Outputable @@ -431,6 +433,7 @@ runTcS context untouch tcs ; return (res, evBindMapBinds ev_binds) } where do_unification (tv,ty) = TcM.writeMetaTyVar tv ty + nestImplicTcS :: EvBindsVar -> TcTyVarSet -> TcS a -> TcS a nestImplicTcS ref untouch tcs @@ -472,6 +475,10 @@ getTcEvBinds = TcS (return . tcs_ev_binds) getTcSTyBinds :: TcS (IORef (Bag (TcTyVar, TcType))) getTcSTyBinds = TcS (return . tcs_ty_binds) +getTcSTyBindsBag :: TcS (Bag (TcTyVar, TcType)) +getTcSTyBindsBag = getTcSTyBinds >>= wrapTcS . (TcM.readTcRef) + + getTcEvBindsBag :: TcS EvBindMap getTcEvBindsBag = do { EvBindsVar ev_ref _ <- getTcEvBinds @@ -570,7 +577,8 @@ newFlattenSkolemTy ty = mkTyVarTy <$> newFlattenSkolemTyVar ty newFlattenSkolemTyVar ty = wrapTcS $ do { uniq <- TcM.newUnique ; let name = mkSysTvName uniq (fsLit "f") - ; return $ mkTcTyVar name (typeKind ty) (FlatSkol ty) + ; return $ + mkTcTyVar name (typeKind ty) (FlatSkol ty) } -- Instantiations