- iImpModInfo :: ImportedModuleInfo,
- -- Modules this one depends on: that is, the union
- -- of the modules its direct imports depend on.
-
- iDecls :: DeclsMap, -- A single, global map of Names to decls
-
- iFixes :: FixityEnv, -- A single, global map of Names to fixities
-
- iSlurp :: NameSet, -- All the names (whether "big" or "small", whether wired-in or not,
- -- whether locally defined or not) that have been slurped in so far.
-
- iVSlurp :: [(Name,Version)], -- All the (a) non-wired-in (b) "big" (c) non-locally-defined
- -- names that have been slurped in so far, with their versions.
- -- This is used to generate the "usage" information for this module.
- -- Subset of the previous field.
-
- iInsts :: Bag GatedDecl,
- -- 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.
-
- iRules :: Bag GatedDecl
- -- Ditto transformation rules
- }
-
-type GatedDecl = (NameSet, (Module, RdrNameHsDecl))
-
-type ImportedModuleInfo
- = FiniteMap ModuleName (Version, Bool, Maybe (Module, Bool, Avails))
- -- Suppose the domain element is module 'A'
+ -- PERSISTENT FIELDS
+ iPIT :: PackageIfaceTable,
+ -- The ModuleIFaces for modules in other packages
+ -- whose interfaces we have opened
+ -- The declarations in these interface files are held in
+ -- iDecls, iInsts, iRules (below), not in the mi_decls fields
+ -- of the iPIT. What _is_ in the iPIT is:
+ -- * The Module
+ -- * Version info
+ -- * Its exports
+ -- * Fixities
+ -- * Deprecations
+ -- The iPIT field is initialised from the compiler's persistent
+ -- package symbol table, and the renamer incrementally adds
+ -- to it.
+
+ iImpModInfo :: ImportedModuleInfo,
+ -- Modules that we know something about, because they are mentioned
+ -- in interface files, BUT which we have not loaded yet.
+ -- No module is both in here and in the PIT
+
+ iDecls :: DeclsMap,
+ -- A single, global map of Names to unslurped decls
+
+ iInsts :: 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.
+
+ iRules :: IfaceRules,
+ -- Similar to instance decls, only for rules
+
+ -- EPHEMERAL FIELDS
+ -- These fields persist during the compilation of a single module only
+ iSlurp :: NameSet,
+ -- All the names (whether "big" or "small", whether wired-in or not,
+ -- whether locally defined or not) that have been slurped in so far.
+
+ iVSlurp :: (ModuleSet, NameSet)
+ -- The Names are all the (a) non-wired-in
+ -- (b) "big"
+ -- (c) non-locally-defined
+ -- (d) home-package
+ -- names that have been slurped in so far, with their versions.
+ -- This is used to generate the "usage" information for this module.
+ -- Subset of the previous field.