+data ExternalPackageState
+ = EPS {
+ 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_decls :: !DeclsMap,
+ -- A single, global map of Names to unslurped decls
+ eps_insts :: !IfaceInsts,
+ -- The as-yet un-slurped instance decls; this bag is depleted when we
+ -- slurp an instance decl so that we don't slurp the same one twice.
+ -- Each is 'gated' by the names that must be available before
+ -- this instance decl is needed.
+ eps_rules :: !IfaceRules,
+ -- Similar to instance decls, only for rules
+
+ eps_inst_gates :: !NameSet -- Gates for instance decls
+ -- The instance gates must accumulate across
+ -- all invocations of the renamer;
+ -- see "the gating story" in RnIfaces.lhs
+ -- These names should all be from other packages;
+ -- for the home package we have all the instance
+ -- declarations anyhow
+ }
+
+emptyExternalPackageState = EPS {
+ eps_decls = (emptyNameEnv, 0),
+ eps_insts = (emptyBag, 0),
+ eps_inst_gates = emptyNameSet,
+ eps_rules = (emptyBag, 0),
+ eps_PIT = emptyPackageIfaceTable,
+ eps_PTE = emptyTypeEnv,
+ eps_inst_env = emptyInstEnv,
+ eps_rule_base = emptyRuleBase
+ }