-data WhatsImported name = NothingAtAll -- The module is below us in the
- -- hierarchy, but we import nothing
- -- Used for orphan modules, so they appear
- -- in the usage list
-
- | Everything Version -- Used for modules from other packages;
- -- we record only the module's version number
-
- | Specifically
- Version -- Module version
- (Maybe Version) -- Export-list version, if we depend on it
- [(name,Version)] -- List guaranteed non-empty
- Version -- Rules version
-
- deriving( Eq )
- -- 'Specifically' doesn't let you say "I imported f but none of the rules in
+-- Dependency info about modules and packages below this one
+-- in the import hierarchy. See TcRnTypes.ImportAvails for details.
+--
+-- Invariant: the dependencies of a module M never includes M
+data Dependencies
+ = Deps { dep_mods :: [(ModuleName,IsBootInterface)], -- Home-package module dependencies
+ dep_pkgs :: [PackageName], -- External package dependencies
+ dep_orphs :: [ModuleName] } -- Orphan modules (whether home or external pkg)
+
+noDependencies :: Dependencies
+noDependencies = Deps [] [] []
+
+data Usage name
+ = Usage { usg_name :: ModuleName, -- Name of the module
+ usg_mod :: Version, -- Module version
+ usg_exports :: Maybe Version, -- Export-list version, if we depend on it
+ usg_entities :: [(name,Version)], -- Sorted by occurrence name
+ usg_rules :: Version -- Rules version
+ } deriving( Eq )
+ -- This type doesn't let you say "I imported f but none of the rules in