ghc-lib-parser-9.14.1.20251220: The GHC API, decoupled from GHC versions

Safe Haskell | Ignore
Language | GHC2021

GHC.Unit.Module.ModSummary

Description

A ModSummary is a node in the compilation manager's dependency graph (ModuleGraph)

Synopsis

- data ModSummary = ModSummary {
  - ms_mod :: Module
  - ms_hsc_src :: HscSource
  - ms_location :: ModLocation
  - ms_hs_hash :: Fingerprint
  - ms_obj_date :: Maybe UTCTime
  - ms_dyn_obj_date :: !(Maybe UTCTime)
  - ms_iface_date :: Maybe UTCTime
  - ms_hie_date :: Maybe UTCTime
  - ms_srcimps :: [Located ModuleName]
  - ms_textual_imps :: [(ImportLevel, PkgQual, Located ModuleName)]
  - ms_parsed_mod :: Maybe HsParsedModule
  - ms_hspp_file :: FilePath
  - ms_hspp_opts :: DynFlags
  - ms_hspp_buf :: Maybe StringBuffer
  }
- ms_unitid :: ModSummary -> UnitId
- ms_installed_mod :: ModSummary -> InstalledModule
- ms_mod_name :: ModSummary -> ModuleName
- ms_imps :: ModSummary -> [(ImportLevel, PkgQual, Located ModuleName)]
- ms_plugin_imps :: ModSummary -> [(ImportLevel, PkgQual, Located ModuleName)]
- ms_mnwib :: ModSummary -> ModuleNameWithIsBoot
- ms_home_srcimps :: ModSummary -> [Located ModuleName]
- ms_home_imps :: ModSummary -> [(ImportLevel, PkgQual, Located ModuleName)]
- msHiFilePath :: ModSummary -> FilePath
- msDynHiFilePath :: ModSummary -> FilePath
- msHsFilePath :: ModSummary -> FilePath
- msObjFilePath :: ModSummary -> FilePath
- msDynObjFilePath :: ModSummary -> FilePath
- msHsFileOsPath :: ModSummary -> OsPath
- msHiFileOsPath :: ModSummary -> OsPath
- msDynHiFileOsPath :: ModSummary -> OsPath
- msObjFileOsPath :: ModSummary -> OsPath
- msDynObjFileOsPath :: ModSummary -> OsPath
- msDeps :: ModSummary -> [(ImportLevel, PkgQual, GenWithIsBoot (Located ModuleName))]
- isBootSummary :: ModSummary -> IsBootInterface
- isTemplateHaskellOrQQNonBoot :: ModSummary -> Bool
- findTarget :: ModSummary -> [Target] -> Maybe Target

# Documentation

data ModSummary #

Data for a module node in a `ModuleGraph`. Module nodes of the module graph are one of:

- A regular Haskell source module
- A hi-boot source module

Constructors

ModSummary |
Fields ms_mod :: Module Identity of the module ms_hsc_src :: HscSource The module source either plain Haskell, hs-boot, or hsig ms_location :: ModLocation Location of the various files belonging to the module ms_hs_hash :: Fingerprint Content hash of source file ms_obj_date :: Maybe UTCTime Timestamp of object, if we have one ms_dyn_obj_date :: !(Maybe UTCTime) Timestamp of dynamic object, if we have one ms_iface_date :: Maybe UTCTime Timestamp of hi file, if we have one See Note [When source is considered modified] and #9243 ms_hie_date :: Maybe UTCTime Timestamp of hie file, if we have one ms_srcimps :: [Located ModuleName] Source imports of the module ms_textual_imps :: [(ImportLevel, PkgQual, Located ModuleName)] Non-source imports of the module from the module *text* ms_parsed_mod :: Maybe HsParsedModule The parsed, nonrenamed source, if we have it. This is also used to support "inline module syntax" in Backpack files. ms_hspp_file :: FilePath Filename of preprocessed source file ms_hspp_opts :: DynFlags Cached flags from `OPTIONS`, `INCLUDE` and `LANGUAGE` pragmas in the modules source code ms_hspp_buf :: Maybe StringBuffer The actual preprocessed source, if we have it

#### Instances

Instances details

Outputable ModSummary # |
Instance details Defined in GHC.Unit.Module.ModSummary Methods ppr :: ModSummary -> SDoc #

ms_unitid :: ModSummary -> UnitId #

ms_installed_mod :: ModSummary -> InstalledModule #

ms_mod_name :: ModSummary -> ModuleName #

ms_imps :: ModSummary -> [(ImportLevel, PkgQual, Located ModuleName)] #

Textual imports, plus plugin imports but not SOURCE imports.

ms_plugin_imps :: ModSummary -> [(ImportLevel, PkgQual, Located ModuleName)] #

Plugin imports

ms_mnwib :: ModSummary -> ModuleNameWithIsBoot #

ms_home_srcimps :: ModSummary -> [Located ModuleName] #

Like `ms_home_imps`, but for SOURCE imports.

ms_home_imps :: ModSummary -> [(ImportLevel, PkgQual, Located ModuleName)] #

All of the (possibly) home module imports from a `ModSummary`; that is to say, each of these module names could be a home import if an appropriately named file existed. (This is in contrast to package qualified imports, which are guaranteed not to be home imports.)

msHiFilePath :: ModSummary -> FilePath #

msDynHiFilePath :: ModSummary -> FilePath #

msHsFilePath :: ModSummary -> FilePath #

msObjFilePath :: ModSummary -> FilePath #

msDynObjFilePath :: ModSummary -> FilePath #

msHsFileOsPath :: ModSummary -> OsPath #

msHiFileOsPath :: ModSummary -> OsPath #

msDynHiFileOsPath :: ModSummary -> OsPath #

msObjFileOsPath :: ModSummary -> OsPath #

msDynObjFileOsPath :: ModSummary -> OsPath #

msDeps :: ModSummary -> [(ImportLevel, PkgQual, GenWithIsBoot (Located ModuleName))] #

Returns the dependencies of the ModSummary s.

isBootSummary :: ModSummary -> IsBootInterface #

Did this `ModSummary` originate from a hs-boot file?

isTemplateHaskellOrQQNonBoot :: ModSummary -> Bool #

findTarget :: ModSummary -> [Target] -> Maybe Target #

Find the first target in the provided list which matches the specified `ModSummary`.