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

Safe Haskell | Ignore
Language | GHC2021

GHC.Unit.Module.ModIface

Synopsis

- type ModIface = ModIface_ 'ModIfaceFinal
- data ModIface_ (phase :: ModIfacePhase)
- pattern ModIface :: IfaceModInfo -> Module -> Maybe Module -> HscSource -> Fingerprint -> Dependencies -> IfacePublic_ phase -> [IfaceExport] -> [(OccName, Fixity)] -> IfaceWarnings -> [IfaceAnnotation] -> [IfaceDeclExts phase] -> Maybe IfaceSimplifiedCore -> [IfaceDefault] -> IfaceTopEnv -> [IfaceClsInst] -> [IfaceFamInst] -> [IfaceRule] -> IfaceTrustInfo -> Bool -> [IfaceCompleteMatch] -> Maybe Docs -> IfaceAbiHashesExts phase -> ExtensibleFields -> IfaceBinHandle phase -> Maybe IfaceSelfRecomp -> (OccName -> Maybe Fixity) -> (OccName -> Maybe (OccName, Fingerprint)) -> (OccName -> Maybe (WarningTxt GhcRn)) -> (Name -> Maybe (WarningTxt GhcRn)) -> ModIface_ phase
- set_mi_mod_info :: forall (phase :: ModIfacePhase). IfaceModInfo -> ModIface_ phase -> ModIface_ phase
- set_mi_module :: forall (phase :: ModIfacePhase). Module -> ModIface_ phase -> ModIface_ phase
- set_mi_sig_of :: forall (phase :: ModIfacePhase). Maybe Module -> ModIface_ phase -> ModIface_ phase
- set_mi_hsc_src :: forall (phase :: ModIfacePhase). HscSource -> ModIface_ phase -> ModIface_ phase
- set_mi_self_recomp :: forall (phase :: ModIfacePhase). Maybe IfaceSelfRecomp -> ModIface_ phase -> ModIface_ phase
- set_mi_hi_bytes :: forall (phase :: ModIfacePhase). IfaceBinHandle phase -> ModIface_ phase -> ModIface_ phase
- set_mi_deps :: forall (phase :: ModIfacePhase). Dependencies -> ModIface_ phase -> ModIface_ phase
- set_mi_exports :: forall (phase :: ModIfacePhase). [IfaceExport] -> ModIface_ phase -> ModIface_ phase
- set_mi_fixities :: forall (phase :: ModIfacePhase). [(OccName, Fixity)] -> ModIface_ phase -> ModIface_ phase
- set_mi_warns :: forall (phase :: ModIfacePhase). IfaceWarnings -> ModIface_ phase -> ModIface_ phase
- set_mi_anns :: forall (phase :: ModIfacePhase). [IfaceAnnotation] -> ModIface_ phase -> ModIface_ phase
- set_mi_insts :: forall (phase :: ModIfacePhase). [IfaceClsInst] -> ModIface_ phase -> ModIface_ phase
- set_mi_fam_insts :: forall (phase :: ModIfacePhase). [IfaceFamInst] -> ModIface_ phase -> ModIface_ phase
- set_mi_rules :: forall (phase :: ModIfacePhase). [IfaceRule] -> ModIface_ phase -> ModIface_ phase
- set_mi_decls :: forall (phase :: ModIfacePhase). [IfaceDeclExts phase] -> ModIface_ phase -> ModIface_ phase
- set_mi_defaults :: forall (phase :: ModIfacePhase). [IfaceDefault] -> ModIface_ phase -> ModIface_ phase
- set_mi_simplified_core :: forall (phase :: ModIfacePhase). Maybe IfaceSimplifiedCore -> ModIface_ phase -> ModIface_ phase
- set_mi_top_env :: forall (phase :: ModIfacePhase). IfaceTopEnv -> ModIface_ phase -> ModIface_ phase
- set_mi_trust :: forall (phase :: ModIfacePhase). IfaceTrustInfo -> ModIface_ phase -> ModIface_ phase
- set_mi_trust_pkg :: forall (phase :: ModIfacePhase). Bool -> ModIface_ phase -> ModIface_ phase
- set_mi_complete_matches :: forall (phase :: ModIfacePhase). [IfaceCompleteMatch] -> ModIface_ phase -> ModIface_ phase
- set_mi_docs :: forall (phase :: ModIfacePhase). Maybe Docs -> ModIface_ phase -> ModIface_ phase
- set_mi_abi_hashes :: forall (phase :: ModIfacePhase). IfaceAbiHashesExts phase -> ModIface_ phase -> ModIface_ phase
- set_mi_ext_fields :: forall (phase :: ModIfacePhase). ExtensibleFields -> ModIface_ phase -> ModIface_ phase
- set_mi_caches :: forall (phase :: ModIfacePhase). IfaceCache -> ModIface_ phase -> ModIface_ phase
- set_mi_decl_warn_fn :: forall (phase :: ModIfacePhase). (OccName -> Maybe (WarningTxt GhcRn)) -> ModIface_ phase -> ModIface_ phase
- set_mi_export_warn_fn :: forall (phase :: ModIfacePhase). (Name -> Maybe (WarningTxt GhcRn)) -> ModIface_ phase -> ModIface_ phase
- set_mi_fix_fn :: forall (phase :: ModIfacePhase). (OccName -> Maybe Fixity) -> ModIface_ phase -> ModIface_ phase
- set_mi_hash_fn :: forall (phase :: ModIfacePhase). (OccName -> Maybe (OccName, Fingerprint)) -> ModIface_ phase -> ModIface_ phase
- completePartialModIface :: PartialModIface -> Fingerprint -> [(Fingerprint, IfaceDecl)] -> Maybe IfaceSimplifiedCore -> IfaceAbiHashes -> IfaceCache -> ModIface
- data IfaceBinHandle (phase :: ModIfacePhase) where
  - PartialIfaceBinHandle :: IfaceBinHandle 'ModIfaceCore
  - FullIfaceBinHandle :: !(Maybe FullBinData) -> IfaceBinHandle 'ModIfaceFinal
- type PartialModIface = ModIface_ 'ModIfaceCore
- data IfaceAbiHashes = IfaceAbiHashes {
  - mi_abi_mod_hash :: !Fingerprint
  - mi_abi_orphan :: !WhetherHasOrphans
  - mi_abi_finsts :: !WhetherHasFamInst
  - mi_abi_export_avails_hash :: !Fingerprint
  - mi_abi_orphan_like_hash :: !Fingerprint
  - mi_abi_orphan_hash :: !Fingerprint
  }
- data IfaceSelfRecomp = IfaceSelfRecomp {
  - mi_sr_src_hash :: !Fingerprint
  - mi_sr_usages :: [Usage]
  - mi_sr_flag_hash :: !(FingerprintWithValue IfaceDynFlags)
  - mi_sr_opt_hash :: !Fingerprint
  - mi_sr_hpc_hash :: !Fingerprint
  - mi_sr_plugin_hash :: !Fingerprint
  }
- data IfaceCache = IfaceCache {
  - mi_cache_decl_warn_fn :: !(OccName -> Maybe (WarningTxt GhcRn))
  - mi_cache_export_warn_fn :: !(Name -> Maybe (WarningTxt GhcRn))
  - mi_cache_fix_fn :: !(OccName -> Maybe Fixity)
  - mi_cache_hash_fn :: !(OccName -> Maybe (OccName, Fingerprint))
  }
- data IfaceSimplifiedCore = IfaceSimplifiedCore {
  - mi_sc_extra_decls :: [IfaceBindingX IfaceMaybeRhs IfaceTopBndrInfo]
  - mi_sc_foreign :: IfaceForeign
  }
- withSelfRecomp :: forall (phase :: ModIfacePhase) r. ModIface_ phase -> r -> (IfaceSelfRecomp -> r) -> r
- type family IfaceDeclExts (phase :: ModIfacePhase) = (decl :: Type) | decl -> phase where ...
- type family IfaceAbiHashesExts (phase :: ModIfacePhase) = (bk :: Type) | bk -> phase where ...
- type IfaceExport = AvailInfo
- data IfacePublic_ (phase :: ModIfacePhase) = IfacePublic {
  - mi_exports_ :: [IfaceExport]
  - mi_fixities_ :: [(OccName, Fixity)]
  - mi_warns_ :: IfaceWarnings
  - mi_anns_ :: [IfaceAnnotation]
  - mi_decls_ :: [IfaceDeclExts phase]
  - mi_defaults_ :: [IfaceDefault]
  - mi_insts_ :: [IfaceClsInst]
  - mi_fam_insts_ :: [IfaceFamInst]
  - mi_rules_ :: [IfaceRule]
  - mi_trust_ :: IfaceTrustInfo
  - mi_trust_pkg_ :: Bool
  - mi_complete_matches_ :: [IfaceCompleteMatch]
  - mi_caches_ :: IfaceCache
  - mi_abi_hashes_ :: IfaceAbiHashesExts phase
  }
- type IfacePublic = IfacePublic_ 'ModIfaceFinal
- type PartialIfacePublic = IfacePublic_ 'ModIfaceCore
- data IfaceModInfo = IfaceModInfo {
  - mi_mod_info_module :: Module
  - mi_mod_info_sig_of :: Maybe Module
  - mi_mod_info_hsc_src :: HscSource
  }
- type WhetherHasOrphans = Bool
- type WhetherHasFamInst = Bool
- data IfaceTopEnv = IfaceTopEnv {
  - ifaceTopExports :: DetOrdAvails
  - ifaceImports :: [IfaceImport]
  }
- data IfaceImport = IfaceImport ImpDeclSpec ImpIfaceList
- mi_boot :: ModIface -> IsBootInterface
- mi_fix :: ModIface -> OccName -> Fixity
- mi_semantic_module :: forall (a :: ModIfacePhase). ModIface_ a -> Module
- mi_mod_info_semantic_module :: IfaceModInfo -> Module
- mi_free_holes :: ModIface -> UniqDSet ModuleName
- mi_mnwib :: ModIface -> ModuleNameWithIsBoot
- mi_flag_hash :: forall (phase :: ModIfacePhase). ModIface_ phase -> Maybe (FingerprintWithValue IfaceDynFlags)
- mi_opt_hash :: forall (phase :: ModIfacePhase). ModIface_ phase -> Maybe Fingerprint
- mi_hpc_hash :: forall (phase :: ModIfacePhase). ModIface_ phase -> Maybe Fingerprint
- mi_plugin_hash :: forall (phase :: ModIfacePhase). ModIface_ phase -> Maybe Fingerprint
- mi_src_hash :: forall (phase :: ModIfacePhase). ModIface_ phase -> Maybe Fingerprint
- mi_usages :: forall (phase :: ModIfacePhase). ModIface_ phase -> Maybe [Usage]
- mi_mod_hash :: ModIface -> Fingerprint
- mi_orphan :: ModIface -> WhetherHasOrphans
- mi_finsts :: ModIface -> WhetherHasFamInst
- mi_export_avails_hash :: ModIface -> Fingerprint
- mi_orphan_like_hash :: ModIface -> Fingerprint
- mi_orphan_hash :: ModIface -> Fingerprint
- renameFreeHoles :: UniqDSet ModuleName -> [(ModuleName, Module)] -> UniqDSet ModuleName
- emptyPartialModIface :: Module -> PartialModIface
- emptyFullModIface :: Module -> ModIface
- mkIfaceHashCache :: [(Fingerprint, IfaceDecl)] -> OccName -> Maybe (OccName, Fingerprint)
- emptyIfaceHashCache :: OccName -> Maybe (OccName, Fingerprint)
- forceModIface :: ModIface -> IO ()

# Documentation

type ModIface = ModIface_ 'ModIfaceFinal #

data ModIface_ (phase :: ModIfacePhase) #

A `ModIface` summarises everything we know about a compiled module.

See Note [Structure of ModIface] for information about what belongs in each field.

See Note [Strictness in ModIface] to learn about why all the fields are lazy.

See Note [Private fields in ModIface] to learn why we don't export any of the fields.

#### Instances

Instances details

Binary ModIface # |
Instance details Defined in GHC.Unit.Module.ModIface Methods put_ :: WriteBinHandle -> ModIface -> IO () # put :: WriteBinHandle -> ModIface -> IO (Bin ModIface) # get :: ReadBinHandle -> IO ModIface #
(NFData (IfaceAbiHashesExts phase), NFData (IfaceDeclExts phase)) => NFData (ModIface_ phase) # |
Instance details Defined in GHC.Unit.Module.ModIface Methods rnf :: ModIface_ phase -> () #

pattern ModIface :: IfaceModInfo -> Module -> Maybe Module -> HscSource -> Fingerprint -> Dependencies -> IfacePublic_ phase -> [IfaceExport] -> [(OccName, Fixity)] -> IfaceWarnings -> [IfaceAnnotation] -> [IfaceDeclExts phase] -> Maybe IfaceSimplifiedCore -> [IfaceDefault] -> IfaceTopEnv -> [IfaceClsInst] -> [IfaceFamInst] -> [IfaceRule] -> IfaceTrustInfo -> Bool -> [IfaceCompleteMatch] -> Maybe Docs -> IfaceAbiHashesExts phase -> ExtensibleFields -> IfaceBinHandle phase -> Maybe IfaceSelfRecomp -> (OccName -> Maybe Fixity) -> (OccName -> Maybe (OccName, Fingerprint)) -> (OccName -> Maybe (WarningTxt GhcRn)) -> (Name -> Maybe (WarningTxt GhcRn)) -> ModIface_ phase #

set_mi_mod_info :: forall (phase :: ModIfacePhase). IfaceModInfo -> ModIface_ phase -> ModIface_ phase #

set_mi_module :: forall (phase :: ModIfacePhase). Module -> ModIface_ phase -> ModIface_ phase #

set_mi_sig_of :: forall (phase :: ModIfacePhase). Maybe Module -> ModIface_ phase -> ModIface_ phase #

set_mi_hsc_src :: forall (phase :: ModIfacePhase). HscSource -> ModIface_ phase -> ModIface_ phase #

set_mi_self_recomp :: forall (phase :: ModIfacePhase). Maybe IfaceSelfRecomp -> ModIface_ phase -> ModIface_ phase #

set_mi_hi_bytes :: forall (phase :: ModIfacePhase). IfaceBinHandle phase -> ModIface_ phase -> ModIface_ phase #

set_mi_deps :: forall (phase :: ModIfacePhase). Dependencies -> ModIface_ phase -> ModIface_ phase #

set_mi_exports :: forall (phase :: ModIfacePhase). [IfaceExport] -> ModIface_ phase -> ModIface_ phase #

set_mi_fixities :: forall (phase :: ModIfacePhase). [(OccName, Fixity)] -> ModIface_ phase -> ModIface_ phase #

set_mi_warns :: forall (phase :: ModIfacePhase). IfaceWarnings -> ModIface_ phase -> ModIface_ phase #

set_mi_anns :: forall (phase :: ModIfacePhase). [IfaceAnnotation] -> ModIface_ phase -> ModIface_ phase #

set_mi_insts :: forall (phase :: ModIfacePhase). [IfaceClsInst] -> ModIface_ phase -> ModIface_ phase #

set_mi_fam_insts :: forall (phase :: ModIfacePhase). [IfaceFamInst] -> ModIface_ phase -> ModIface_ phase #

set_mi_rules :: forall (phase :: ModIfacePhase). [IfaceRule] -> ModIface_ phase -> ModIface_ phase #

set_mi_decls :: forall (phase :: ModIfacePhase). [IfaceDeclExts phase] -> ModIface_ phase -> ModIface_ phase #

set_mi_defaults :: forall (phase :: ModIfacePhase). [IfaceDefault] -> ModIface_ phase -> ModIface_ phase #

set_mi_simplified_core :: forall (phase :: ModIfacePhase). Maybe IfaceSimplifiedCore -> ModIface_ phase -> ModIface_ phase #

set_mi_top_env :: forall (phase :: ModIfacePhase). IfaceTopEnv -> ModIface_ phase -> ModIface_ phase #

set_mi_trust :: forall (phase :: ModIfacePhase). IfaceTrustInfo -> ModIface_ phase -> ModIface_ phase #

set_mi_trust_pkg :: forall (phase :: ModIfacePhase). Bool -> ModIface_ phase -> ModIface_ phase #

set_mi_complete_matches :: forall (phase :: ModIfacePhase). [IfaceCompleteMatch] -> ModIface_ phase -> ModIface_ phase #

set_mi_docs :: forall (phase :: ModIfacePhase). Maybe Docs -> ModIface_ phase -> ModIface_ phase #

set_mi_abi_hashes :: forall (phase :: ModIfacePhase). IfaceAbiHashesExts phase -> ModIface_ phase -> ModIface_ phase #

set_mi_ext_fields :: forall (phase :: ModIfacePhase). ExtensibleFields -> ModIface_ phase -> ModIface_ phase #

set_mi_caches :: forall (phase :: ModIfacePhase). IfaceCache -> ModIface_ phase -> ModIface_ phase #

set_mi_decl_warn_fn :: forall (phase :: ModIfacePhase). (OccName -> Maybe (WarningTxt GhcRn)) -> ModIface_ phase -> ModIface_ phase #

set_mi_export_warn_fn :: forall (phase :: ModIfacePhase). (Name -> Maybe (WarningTxt GhcRn)) -> ModIface_ phase -> ModIface_ phase #

set_mi_fix_fn :: forall (phase :: ModIfacePhase). (OccName -> Maybe Fixity) -> ModIface_ phase -> ModIface_ phase #

set_mi_hash_fn :: forall (phase :: ModIfacePhase). (OccName -> Maybe (OccName, Fingerprint)) -> ModIface_ phase -> ModIface_ phase #

completePartialModIface :: PartialModIface -> Fingerprint -> [(Fingerprint, IfaceDecl)] -> Maybe IfaceSimplifiedCore -> IfaceAbiHashes -> IfaceCache -> ModIface #

Given a `PartialModIface`, turn it into a `ModIface` by completing missing fields.

data IfaceBinHandle (phase :: ModIfacePhase) where #

In-memory byte array representation of a `ModIface`.

See Note [Sharing of ModIface] for why we need this.

Constructors

PartialIfaceBinHandle :: IfaceBinHandle 'ModIfaceCore | A partial `ModIface` cannot be serialised to disk.
FullIfaceBinHandle :: !(Maybe FullBinData) -> IfaceBinHandle 'ModIfaceFinal | Optional `FullBinData` that can be serialised to disk directly. See Note [Private fields in ModIface] for when this fields needs to be cleared (e.g., set to `Nothing`).

type PartialModIface = ModIface_ 'ModIfaceCore #

data IfaceAbiHashes #

Extends a PartialModIface with hashes of the ABI.

- The mi_mod_hash is the hash of the entire ABI
- THe other fields are more specific hashes of parts of the ABI

Constructors

IfaceAbiHashes |
Fields mi_abi_mod_hash :: !Fingerprint Hash of the ABI only mi_abi_orphan :: !WhetherHasOrphans Whether this module has orphans mi_abi_finsts :: !WhetherHasFamInst Whether this module has family instances. See Note [The type family instance consistency story]. mi_abi_export_avails_hash :: !Fingerprint Hash of the exported avails (does not include e.g. instances) mi_abi_orphan_like_hash :: !Fingerprint Orphans, together with (non-orphan) type family instances of dependencies and a few other things; see Note [Orphan-like hash]. If this changes, we must recompile due to the impact on instance resolution. mi_abi_orphan_hash :: !Fingerprint Hash for orphan rules, class and family instances combined NOT transitive

#### Instances

Instances details

NFData IfaceAbiHashes # |
Instance details Defined in GHC.Unit.Module.ModIface Methods rnf :: IfaceAbiHashes -> () #
Binary IfaceAbiHashes # |
Instance details Defined in GHC.Unit.Module.ModIface Methods put_ :: WriteBinHandle -> IfaceAbiHashes -> IO () # put :: WriteBinHandle -> IfaceAbiHashes -> IO (Bin IfaceAbiHashes) # get :: ReadBinHandle -> IO IfaceAbiHashes #

data IfaceSelfRecomp #

The information for a module which is only used when deciding whether to recompile itself.

See Note [Self recompilation information in interface files]

Constructors

IfaceSelfRecomp |
Fields mi_sr_src_hash :: !Fingerprint Hash of the .hs source, used for recompilation checking. mi_sr_usages :: [Usage] Usages; kept sorted so that it's easy to decide whether to write a new iface file (changing usages doesn't affect the hash of this module) NOT STRICT! we read this field lazily from the interface file It is *only* consulted by the recompilation checker mi_sr_flag_hash :: !(FingerprintWithValue IfaceDynFlags) Hash of the important flags used when compiling the module, excluding optimisation flags mi_sr_opt_hash :: !Fingerprint Hash of optimisation flags mi_sr_hpc_hash :: !Fingerprint Hash of hpc flags mi_sr_plugin_hash :: !Fingerprint Hash of plugins

#### Instances

Instances details

NFData IfaceSelfRecomp # |
Instance details Defined in GHC.Iface.Recomp.Types Methods rnf :: IfaceSelfRecomp -> () #
Binary IfaceSelfRecomp # |
Instance details Defined in GHC.Iface.Recomp.Types Methods put_ :: WriteBinHandle -> IfaceSelfRecomp -> IO () # put :: WriteBinHandle -> IfaceSelfRecomp -> IO (Bin IfaceSelfRecomp) # get :: ReadBinHandle -> IO IfaceSelfRecomp #
Outputable IfaceSelfRecomp # |
Instance details Defined in GHC.Iface.Recomp.Types Methods ppr :: IfaceSelfRecomp -> SDoc #

data IfaceCache #

Constructors

IfaceCache |
Fields mi_cache_decl_warn_fn :: !(OccName -> Maybe (WarningTxt GhcRn)) Cached lookup for `mi_warns` for declaration deprecations mi_cache_export_warn_fn :: !(Name -> Maybe (WarningTxt GhcRn)) Cached lookup for `mi_warns` for export deprecations mi_cache_fix_fn :: !(OccName -> Maybe Fixity) Cached lookup for `mi_fixities` mi_cache_hash_fn :: !(OccName -> Maybe (OccName, Fingerprint)) Cached lookup for `mi_decls`. The `Nothing` in `mi_hash_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. The `OccName` is the parent of the name, if it has one.

#### Instances

Instances details

NFData IfaceCache # |
Instance details Defined in GHC.Unit.Module.ModIface Methods rnf :: IfaceCache -> () #

data IfaceSimplifiedCore #

The information needed to restart bytecode generation. Enabled by `-fwrite-if-simplified-core`.

Constructors

IfaceSimplifiedCore |
Fields mi_sc_extra_decls :: [IfaceBindingX IfaceMaybeRhs IfaceTopBndrInfo] Extra variable definitions which are **NOT** exposed but when combined with mi_decls allows us to restart code generation. See Note [Interface Files with Core Definitions] and Note [Interface File with Core: Sharing RHSs] mi_sc_foreign :: IfaceForeign Foreign stubs and files to supplement `mi_extra_decls_`. See Note [Foreign stubs and TH bytecode linking]

#### Instances

Instances details

NFData IfaceSimplifiedCore # |
Instance details Defined in GHC.Unit.Module.ModIface Methods rnf :: IfaceSimplifiedCore -> () #
Binary IfaceSimplifiedCore # |
Instance details Defined in GHC.Unit.Module.ModIface Methods put_ :: WriteBinHandle -> IfaceSimplifiedCore -> IO () # put :: WriteBinHandle -> IfaceSimplifiedCore -> IO (Bin IfaceSimplifiedCore) # get :: ReadBinHandle -> IO IfaceSimplifiedCore #

withSelfRecomp :: forall (phase :: ModIfacePhase) r. ModIface_ phase -> r -> (IfaceSelfRecomp -> r) -> r #

type family IfaceDeclExts (phase :: ModIfacePhase) = (decl :: Type) | decl -> phase where ... #

Selects a IfaceDecl representation. For fully instantiated interfaces we also maintain a fingerprint, which is used for recompilation checks.

Equations

IfaceDeclExts 'ModIfaceCore = IfaceDecl |
IfaceDeclExts 'ModIfaceFinal = (Fingerprint, IfaceDecl) |

type family IfaceAbiHashesExts (phase :: ModIfacePhase) = (bk :: Type) | bk -> phase where ... #

Equations

IfaceAbiHashesExts 'ModIfaceCore = () |
IfaceAbiHashesExts 'ModIfaceFinal = IfaceAbiHashes |

type IfaceExport = AvailInfo #

data IfacePublic_ (phase :: ModIfacePhase) #

The public interface of a module which are used by other modules when importing this module. The ABI of a module.

Constructors

IfacePublic |
Fields mi_exports_ :: [IfaceExport] Exports Kept sorted by (mod,occ), to make version comparisons easier Records the modules that are the declaration points for things exported by this module, and the `OccName`s of those things mi_fixities_ :: [(OccName, Fixity)] Fixities NOT STRICT! we read this field lazily from the interface file mi_warns_ :: IfaceWarnings Warnings NOT STRICT! we read this field lazily from the interface file mi_anns_ :: [IfaceAnnotation] Annotations NOT STRICT! we read this field lazily from the interface file mi_decls_ :: [IfaceDeclExts phase] Type, class and variable declarations The hash 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 hash of the parent class/tycon changes mi_defaults_ :: [IfaceDefault] default declarations exported by the module mi_insts_ :: [IfaceClsInst] Sorted class instance mi_fam_insts_ :: [IfaceFamInst] Sorted family instances mi_rules_ :: [IfaceRule] Sorted rules mi_trust_ :: IfaceTrustInfo Safe Haskell Trust information for this module. mi_trust_pkg_ :: Bool Do we require the package this module resides in be trusted to trust this module? This is used for the situation where a module is Safe (so doesn't require the package be trusted itself) but imports some trustworthy modules from its own package (which does require its own package be trusted). See Note [Trust Own Package] in GHC.Rename.Names mi_complete_matches_ :: [IfaceCompleteMatch] {-# COMPLETE #-} declarations mi_caches_ :: IfaceCache Cached lookups of some parts of mi_public mi_abi_hashes_ :: IfaceAbiHashesExts phase Either `()` or `IfaceAbiHashes` for a fully instantiated interface. These fields are hashes of different parts of the public interface.

#### Instances

Instances details

(NFData (IfaceAbiHashesExts phase), NFData (IfaceDeclExts phase)) => NFData (IfacePublic_ phase) # |
Instance details Defined in GHC.Unit.Module.ModIface Methods rnf :: IfacePublic_ phase -> () #

type IfacePublic = IfacePublic_ 'ModIfaceFinal #

type PartialIfacePublic = IfacePublic_ 'ModIfaceCore #

data IfaceModInfo #

Meta information about the module the interface file is for

Constructors

IfaceModInfo |
Fields mi_mod_info_module :: Module Name of the module we are for mi_mod_info_sig_of :: Maybe Module Are we a sig of another mod? mi_mod_info_hsc_src :: HscSource Boot? Signature?

#### Instances

Instances details

NFData IfaceModInfo # |
Instance details Defined in GHC.Unit.Module.ModIface Methods rnf :: IfaceModInfo -> () #
Binary IfaceModInfo # |
Instance details Defined in GHC.Unit.Module.ModIface Methods put_ :: WriteBinHandle -> IfaceModInfo -> IO () # put :: WriteBinHandle -> IfaceModInfo -> IO (Bin IfaceModInfo) # get :: ReadBinHandle -> IO IfaceModInfo #

type WhetherHasOrphans = Bool #

Records whether a module has orphans. An "orphan" is one of:

- An instance declaration in a module other than the definition module for one of the type constructors or classes in the instance head
- A rewrite rule in a module other than the one defining the function in the head of the rule

type WhetherHasFamInst = Bool #

Does this module define family instances?

data IfaceTopEnv #

Constructors

IfaceTopEnv |
Fields ifaceTopExports :: DetOrdAvails all top level things in this module, including unexported stuff ifaceImports :: [IfaceImport] all the imports in this module

#### Instances

Instances details

NFData IfaceTopEnv # |
Instance details Defined in GHC.Unit.Module.ModIface Methods rnf :: IfaceTopEnv -> () #
Binary IfaceTopEnv # |
Instance details Defined in GHC.Unit.Module.ModIface Methods put_ :: WriteBinHandle -> IfaceTopEnv -> IO () # put :: WriteBinHandle -> IfaceTopEnv -> IO (Bin IfaceTopEnv) # get :: ReadBinHandle -> IO IfaceTopEnv #

data IfaceImport #

Constructors

IfaceImport ImpDeclSpec ImpIfaceList |

#### Instances

Instances details

NFData IfaceImport # |
Instance details Defined in GHC.Iface.Syntax Methods rnf :: IfaceImport -> () #
Binary IfaceImport # |
Instance details Defined in GHC.Iface.Syntax Methods put_ :: WriteBinHandle -> IfaceImport -> IO () # put :: WriteBinHandle -> IfaceImport -> IO (Bin IfaceImport) # get :: ReadBinHandle -> IO IfaceImport #

mi_boot :: ModIface -> IsBootInterface #

Old-style accessor for whether or not the ModIface came from an hs-boot file.

mi_fix :: ModIface -> OccName -> Fixity #

Lookups up a (possibly cached) fixity from a `ModIface`. If one cannot be found, `defaultFixity` is returned instead.

mi_semantic_module :: forall (a :: ModIfacePhase). ModIface_ a -> Module #

mi_mod_info_semantic_module :: IfaceModInfo -> Module #

The semantic module for this interface; e.g., if it's a interface for a signature, if `mi_module` is `p[A=A]:A`, `mi_semantic_module` will be `A`.

mi_free_holes :: ModIface -> UniqDSet ModuleName #

The "precise" free holes, e.g., the signatures that this `ModIface` depends on.

mi_mnwib :: ModIface -> ModuleNameWithIsBoot #

mi_flag_hash :: forall (phase :: ModIfacePhase). ModIface_ phase -> Maybe (FingerprintWithValue IfaceDynFlags) #

mi_opt_hash :: forall (phase :: ModIfacePhase). ModIface_ phase -> Maybe Fingerprint #

mi_hpc_hash :: forall (phase :: ModIfacePhase). ModIface_ phase -> Maybe Fingerprint #

mi_plugin_hash :: forall (phase :: ModIfacePhase). ModIface_ phase -> Maybe Fingerprint #

mi_src_hash :: forall (phase :: ModIfacePhase). ModIface_ phase -> Maybe Fingerprint #

mi_usages :: forall (phase :: ModIfacePhase). ModIface_ phase -> Maybe [Usage] #

mi_mod_hash :: ModIface -> Fingerprint #

Accessor for the module hash of the ABI from a ModIface.

mi_orphan :: ModIface -> WhetherHasOrphans #

Accessor for whether this module has orphans from a ModIface.

mi_finsts :: ModIface -> WhetherHasFamInst #

Accessor for whether this module has family instances from a ModIface.

mi_export_avails_hash :: ModIface -> Fingerprint #

Accessor for the hash of exported avails.

mi_orphan_like_hash :: ModIface -> Fingerprint #

Accessor for the hash of orphans and dependencies.

See Note [Orphan-like hash].

mi_orphan_hash :: ModIface -> Fingerprint #

Accessor for the hash of orphan rules, class and family instances combined from a ModIface.

renameFreeHoles :: UniqDSet ModuleName -> [(ModuleName, Module)] -> UniqDSet ModuleName #

Given a set of free holes, and a unit identifier, rename the free holes according to the instantiation of the unit identifier. For example, if we have A and B free, and our unit identity is `p[A=C,B=impl:B]`, the renamed free holes are just C.

emptyPartialModIface :: Module -> PartialModIface #

emptyFullModIface :: Module -> ModIface #

mkIfaceHashCache :: [(Fingerprint, IfaceDecl)] -> OccName -> Maybe (OccName, Fingerprint) #

Constructs cache for the `mi_hash_fn` field of a `ModIface`

emptyIfaceHashCache :: OccName -> Maybe (OccName, Fingerprint) #

forceModIface :: ModIface -> IO () #