- mi_module :: Module, -- Complete with package info
- mi_version :: VersionInfo, -- Module version number
- mi_orphan :: WhetherHasOrphans, -- Whether this module has orphans
- mi_boot :: IsBootInterface, -- Whether this interface was read from an hi-boot file
-
- mi_usages :: [ImportVersion Name], -- Usages; kept sorted so that it's easy
- -- to decide whether to write a new iface file
- -- (changing usages doesn't affect the version of
- -- this module)
-
- mi_exports :: [(ModuleName,Avails)], -- What it exports
- -- Kept sorted by (mod,occ),
- -- to make version comparisons easier
-
- mi_globals :: GlobalRdrEnv, -- Its top level environment
-
- mi_fixities :: NameEnv Fixity, -- Fixities
- mi_deprecs :: Deprecations, -- Deprecations
-
- mi_decls :: IfaceDecls -- The RnDecls form of ModDetails
+ mi_package :: !PackageName, -- Which package the module comes from
+ mi_module :: !Module,
+ mi_mod_vers :: !Version, -- Module version: changes when anything changes
+
+ mi_orphan :: !WhetherHasOrphans, -- Whether this module has orphans
+ mi_boot :: !IsBootInterface, -- Read from an hi-boot file?
+
+ mi_deps :: Dependencies,
+ -- This is consulted for directly-imported modules,
+ -- but not for anything else (hence lazy)
+
+ -- Usages; kept sorted so that it's easy to decide
+ -- whether to write a new iface file (changing usages
+ -- doesn't affect the version of this module)
+ mi_usages :: [Usage],
+ -- NOT STRICT! we read this field lazily from the interface file
+ -- It is *only* consulted by the recompilation checker
+
+ -- Exports
+ -- Kept sorted by (mod,occ), to make version comparisons easier
+ mi_exports :: ![IfaceExport],
+ mi_exp_vers :: !Version, -- Version number of export list
+
+ -- Fixities
+ mi_fixities :: [(OccName,Fixity)],
+ -- NOT STRICT! we read this field lazily from the interface file
+
+ -- Deprecations
+ mi_deprecs :: IfaceDeprecs,
+ -- NOT STRICT! we read this field lazily from the interface file
+
+ -- Type, class and variable declarations
+ -- The version of an Id changes if its fixity or deprecations change
+ -- (as well as its type of course)
+ -- Ditto data constructors, class operations, except that
+ -- the version of the parent class/tycon changes
+ mi_decls :: [(Version,IfaceDecl)], -- Sorted
+
+ -- Instance declarations and rules
+ mi_insts :: [IfaceInst], -- Sorted
+ mi_rules :: [IfaceRule], -- Sorted
+ mi_rule_vers :: !Version, -- Version number for rules and instances combined
+
+ -- Cached environments for easy lookup
+ -- These are computed (lazily) from other fields
+ -- and are not put into the interface file
+ mi_dep_fn :: Name -> Maybe DeprecTxt, -- Cached lookup for mi_deprecs
+ mi_fix_fn :: OccName -> Fixity, -- Cached lookup for mi_fixities
+ mi_ver_fn :: OccName -> Maybe Version -- Cached lookup for mi_decls
+ -- The Nothing in mi_ver_fn means that the thing
+ -- isn't in decls. It's useful to know that when
+ -- seeing if we are up to date wrt the old interface