-data PersistentRenamerState
- = PRS { prsOrig :: !NameSupply,
- prsImpMods :: !ImportedModuleInfo,
-
- -- Holding pens for stuff that has been read in
- -- but not yet slurped into the renamer
- prsDecls :: !DeclsMap,
- prsInsts :: !IfaceInsts,
- prsRules :: !IfaceRules
- }
+data ExternalPackageState
+ = EPS {
+ eps_is_boot :: !(ModuleEnv (Module, IsBootInterface)),
+ -- In OneShot mode (only), home-package modules accumulate in the
+ -- external package state, and are sucked in lazily.
+ -- For these home-pkg modules (only) we need to record which are
+ -- boot modules. We set this field after loading all the
+ -- explicitly-imported interfaces, but before doing anything else
+ --
+ -- The Module part is not necessary, but it's useful for
+ -- debug prints, and it's convenient because this field comes
+ -- direct from TcRnTypes.ImportAvails.imp_dep_mods
+
+ eps_PIT :: !PackageIfaceTable,
+ -- The ModuleIFaces for modules in external packages
+ -- whose interfaces we have opened
+ -- The declarations in these interface files are held in
+ -- eps_decls, eps_insts, eps_rules (below), not in the
+ -- mi_decls fields of the iPIT.
+ -- What _is_ in the iPIT is:
+ -- * The Module
+ -- * Version info
+ -- * Its exports
+ -- * Fixities
+ -- * Deprecations
+
+ eps_PTE :: !PackageTypeEnv, -- Domain = external-package modules
+
+ eps_inst_env :: !PackageInstEnv, -- The total InstEnv accumulated from
+ -- all the external-package modules
+ eps_rule_base :: !PackageRuleBase, -- Ditto RuleEnv
+
+
+ -- Holding pens for stuff that has been read in from file,
+ -- but not yet slurped into the renamer
+ eps_insts :: !InstPool,
+ -- The as-yet un-slurped instance decls
+ -- Decls move from here to eps_inst_env
+ -- Each instance is 'gated' by the names that must be
+ -- available before this instance decl is needed.
+
+ eps_rules :: !RulePool,
+ -- The as-yet un-slurped rules
+
+ eps_stats :: !EpsStats
+ }
+
+-- "In" means read from iface files
+-- "Out" means actually sucked in and type-checked
+data EpsStats = EpsStats { n_ifaces_in
+ , n_decls_in, n_decls_out
+ , n_rules_in, n_rules_out
+ , n_insts_in, n_insts_out :: !Int }