+ tcg_rules :: [LRuleDecl Id], -- ...Rules
+ tcg_fords :: [LForeignDecl Id] -- ...Foreign import & exports
+ }
+\end{code}
+
+%************************************************************************
+%* *
+ The interface environments
+ Used when dealing with IfaceDecls
+%* *
+%************************************************************************
+
+\begin{code}
+data IfGblEnv
+ = IfGblEnv {
+ -- The type environment for the module being compiled,
+ -- in case the interface refers back to it via a reference that
+ -- was originally a hi-boot file.
+ -- We need the module name so we can test when it's appropriate
+ -- to look in this env.
+ if_rec_types :: Maybe (Module, IfG TypeEnv),
+ -- Allows a read effect, so it can be in a mutable
+ -- variable; c.f. handling the external package type env
+ -- Nothing => interactive stuff, no loops possible
+
+ if_is_boot :: ModuleEnv (ModuleName, IsBootInterface)
+ -- Tells what we know about boot interface files
+ -- When we're importing a module we know absolutely
+ -- nothing about, so we assume it's from
+ -- another package, where we aren't doing
+ -- dependency tracking. So it won't be a hi-boot file.
+ }
+
+data IfLclEnv
+ = IfLclEnv {
+ -- The module for the current IfaceDecl
+ -- So if we see f = \x -> x
+ -- it means M.f = \x -> x, where M is the if_mod
+ if_mod :: ModuleName,
+
+ if_tv_env :: OccEnv TyVar, -- Nested tyvar bindings
+ if_id_env :: OccEnv Id -- Nested id binding