import TcRnTypes -- Re-export all
import IOEnv -- Re-export all
-#if defined(GHCI) && defined(BREAKPOINT)
+#if defined(GHCI)
import TypeRep
-import Var
import IdInfo
-import OccName
-import SrcLoc
import TysWiredIn
import PrelNames
-import NameEnv
-import TcEnv
+import {-#SOURCE#-} TcEnv
#endif
import HsSyn hiding (LIE)
import Bag
import Outputable
import UniqSupply
-import UniqFM
import Unique
import DynFlags
import StaticFlags
\end{code}
\begin{code}
+
initTc :: HscEnv
-> HscSource
-> Module
tcg_inst_uses = dfuns_var,
tcg_th_used = th_var,
tcg_exports = [],
- tcg_imports = init_imports,
+ tcg_imports = emptyImportAvails,
tcg_dus = emptyDUs,
tcg_rn_imports = Nothing,
tcg_rn_exports = Nothing,
return (msgs, final_res)
}
- where
- init_imports = emptyImportAvails {imp_env = unitUFM (moduleName mod) []}
- -- Initialise tcg_imports with an empty set of bindings for
- -- this module, so that if we see 'module M' in the export
- -- list, and there are no bindings in M, we don't bleat
- -- "unknown module M".
initTcPrintErrors -- Used from the interactive loop only
:: HscEnv
\begin{code}
addBreakpointBindings :: TcM a -> TcM a
addBreakpointBindings thing_inside
-#if defined(GHCI) && defined(BREAKPOINT)
- = do { unique <- newUnique
- ; let { var = mkInternalName unique (mkOccName tvName "a") noSrcLoc;
- tyvar = mkTyVar var liftedTypeKind;
- basicType extra = (FunTy intTy
- (FunTy (mkListTy unitTy)
- (FunTy stringTy
- (ForAllTy tyvar
- (extra
- (FunTy (TyVarTy tyvar)
- (TyVarTy tyvar)))))));
- breakpointJumpId
- = mkGlobalId VanillaGlobal breakpointJumpName
- (basicType id) vanillaIdInfo;
- breakpointCondJumpId
- = mkGlobalId VanillaGlobal breakpointCondJumpName
- (basicType (FunTy boolTy)) vanillaIdInfo
- }
- ; tcExtendIdEnv [breakpointJumpId, breakpointCondJumpId] thing_inside}
-#else
= thing_inside
-#endif
+
\end{code}
%************************************************************************
= updGblEnv (\env@(TcGblEnv { tcg_fix_env = old_fix_env }) ->
env {tcg_fix_env = extendNameEnvList old_fix_env new_bit})
-getDefaultTys :: TcRn (Maybe [Type])
-getDefaultTys = do { env <- getGblEnv; return (tcg_default env) }
+getDeclaredDefaultTys :: TcRn (Maybe [Type])
+getDeclaredDefaultTys = do { env <- getGblEnv; return (tcg_default env) }
\end{code}
%************************************************************************