Moduleghc-10.0.0.20260917GHC2024
GHC.Unit.Module.ModIface
- 17 types
- 85 values
- Packageghc-10.0.0.20260917
- Exports105
- LanguageGHC2024
- LicenceBSD-3-Clause
- SourceModIface.hs
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.
Instances2Binary, NFData
Binary ModIfaceDefined in ghc-10.0.0.20260917 · GHC.Unit.Module.ModIface(NFData (IfaceAbiHashesExts phase), NFData (IfaceDeclExts phase)) => NFData (ModIface_ phase)Defined in ghc-10.0.0.20260917 · GHC.Unit.Module.ModIface
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_ phaseGiven a PartialModIface, turn it into a ModIface by completing missing fields.
In-memory byte array representation of a ModIface.
See Note [Sharing of ModIface] for why we need this.
Constructors
PartialIfaceBinHandle :: IfaceBinHandle 'ModIfaceCoreA partial ModIface cannot be serialised to disk.
FullIfaceBinHandle :: !Maybe FullBinData -> IfaceBinHandle 'ModIfaceFinalOptional 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).
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
IfaceAbiHashesmi_abi_mod_hash :: !FingerprintHash of the ABI only
mi_abi_orphan :: !WhetherHasOrphansWhether this module has orphans
mi_abi_finsts :: !WhetherHasFamInstWhether this module has family instances. See Note [The type family instance consistency story].
mi_abi_export_avails_hash :: !FingerprintHash of the exported avails (does not include e.g. instances)
mi_abi_orphan_like_hash :: !FingerprintOrphans, 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 :: !FingerprintHash for orphan rules, class and family instances combined NOT transitive
Instances2NFData, Binary
NFData IfaceAbiHashesDefined in ghc-10.0.0.20260917 · GHC.Unit.Module.ModIfaceBinary IfaceAbiHashesDefined in ghc-10.0.0.20260917 · GHC.Unit.Module.ModIface
The information for a module which is only used when deciding whether to recompile itself.
See Note [Self recompilation information in interface files]
Constructors
IfaceSelfRecompmi_sr_src_hash :: !FingerprintHash 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 IfaceDynFlagsHash of the important flags used when compiling the module, excluding optimisation flags
mi_sr_opt_hash :: !FingerprintHash of optimisation flags
mi_sr_hpc_hash :: !FingerprintHash of hpc flags
mi_sr_plugin_hash :: !FingerprintHash of plugins
Instances3NFData, Outputable, Binary
NFData IfaceSelfRecompDefined in ghc-10.0.0.20260917 · GHC.Iface.Recomp.TypesOutputable IfaceSelfRecompDefined in ghc-10.0.0.20260917 · GHC.Iface.Recomp.TypesBinary IfaceSelfRecompDefined in ghc-10.0.0.20260917 · GHC.Iface.Recomp.Types
Constructors
IfaceCachemi_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 FixityCached lookup for mi_fixities
mi_cache_hash_fn :: !OccName -> Maybe (OccName, Fingerprint)Cached lookup for mi_decls. The
Nothingin 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.
Instances1NFData
NFData IfaceCacheDefined in ghc-10.0.0.20260917 · GHC.Unit.Module.ModIface
The information needed to restart bytecode generation. Enabled by `-fwrite-if-simplified-core`.
Constructors
IfaceSimplifiedCoremi_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_modBreaks :: Maybe ModBreaksIf breakpoints are present in
mi_sc_extra_declsthis field provides this field provides the metadata required by the bytecode debugger.mi_sc_foreign :: IfaceForeignForeign stubs and files to supplement
mi_extra_decls_. See Note [Foreign stubs and TH bytecode linking]
Instances2NFData, Binary
NFData IfaceSimplifiedCoreDefined in ghc-10.0.0.20260917 · GHC.Unit.Module.ModIfaceBinary IfaceSimplifiedCoreDefined in ghc-10.0.0.20260917 · GHC.Unit.Module.ModIface
Selects a IfaceDecl representation. For fully instantiated interfaces we also maintain a fingerprint, which is used for recompilation checks.
Equations
IfaceDeclExts 'ModIfaceCore = IfaceDeclIfaceDeclExts 'ModIfaceFinal = (Fingerprint, IfaceDecl)
Equations
IfaceAbiHashesExts 'ModIfaceCore = ()IfaceAbiHashesExts 'ModIfaceFinal = IfaceAbiHashes
The public interface of a module which are used by other modules when importing this module. The ABI of a module.
Constructors
IfacePublicmi_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 OccNames of those things
mi_fixities_ :: [(OccName, Fixity)]Fixities NOT STRICT! we read this field lazily from the interface file
mi_warns_ :: IfaceWarningsWarnings 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_ :: IfaceTrustInfoSafe Haskell Trust information for this module.
mi_trust_pkg_ :: BoolDo 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_ :: IfaceCacheCached lookups of some parts of mi_public
mi_abi_hashes_ :: IfaceAbiHashesExts phaseEither
()or IfaceAbiHashes for a fully instantiated interface. These fields are hashes of different parts of the public interface.
Instances2NFData, Binary
(NFData (IfaceAbiHashesExts phase), NFData (IfaceDeclExts phase)) => NFData (IfacePublic_ phase)Defined in ghc-10.0.0.20260917 · GHC.Unit.Module.ModIfaceBinary (IfacePublic_ 'ModIfaceFinal)Defined in ghc-10.0.0.20260917 · GHC.Unit.Module.ModIface
Meta information about the module the interface file is for
Constructors
IfaceModInfomi_mod_info_module :: ModuleName of the module we are for
mi_mod_info_sig_of :: Maybe ModuleAre we a sig of another mod?
mi_mod_info_hsc_src :: HscSourceBoot? Signature?
Instances2NFData, Binary
NFData IfaceModInfoDefined in ghc-10.0.0.20260917 · GHC.Unit.Module.ModIfaceBinary IfaceModInfoDefined in ghc-10.0.0.20260917 · GHC.Unit.Module.ModIface
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
Does this module define family instances?
Constructors
IfaceTopEnvifaceTopExports :: DetOrdAvailsall top level things in this module, including unexported stuff
ifaceImports :: [IfaceImport]all the imports in this module
Instances2NFData, Binary
NFData IfaceTopEnvDefined in ghc-10.0.0.20260917 · GHC.Unit.Module.ModIfaceBinary IfaceTopEnvDefined in ghc-10.0.0.20260917 · GHC.Unit.Module.ModIface
Constructors
Instances2NFData, Binary
NFData IfaceImportDefined in ghc-10.0.0.20260917 · GHC.Iface.SyntaxBinary IfaceImportDefined in ghc-10.0.0.20260917 · GHC.Iface.Syntax
Old-style accessor for whether or not the ModIface came from an hs-boot file.
Lookups up a (possibly cached) fixity from a ModIface. If one cannot be found, defaultFixity is returned instead.
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.
The "precise" free holes, e.g., the signatures that this ModIface depends on.
Accessor for the module hash of the ABI from a ModIface.
Accessor for whether this module has orphans from a ModIface.
Accessor for whether this module has family instances from a ModIface.
Accessor for the hash of exported avails.
Accessor for the hash of orphans and dependencies.
See Note [Orphan-like hash].
Accessor for the hash of orphan rules, class and family instances combined from a ModIface.
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.
Constructs cache for the mi_hash_fn field of a ModIface