ghc-9.12.0.20241114: The GHC API
Safe HaskellNone
LanguageGHC2021

GHC.Unit.Module

Synopsis

Documentation

The ModuleName type

The ModLocation type

ModuleEnv

Generalization

getModuleInstantiation :: Module -> (InstalledModule, Maybe InstantiatedModule) Source #

Given a possibly on-the-fly instantiated module, split it into a Module that we definitely can find on-disk, as well as an instantiation if we need to instantiate it on the fly. If the instantiation is Nothing no on-the-fly renaming is needed.

getUnitInstantiations :: Unit -> (UnitId, Maybe InstantiatedUnit) Source #

Return the unit-id this unit is an instance of and the module instantiations (if any).

uninstantiateInstantiatedUnit :: InstantiatedUnit -> InstantiatedUnit Source #

Remove instantiations of the given instantiated unit

uninstantiateInstantiatedModule :: InstantiatedModule -> InstantiatedModule Source #

Remove instantiations of the given module instantiated unit

The Module type

mkHoleModule :: ModuleName -> GenModule (GenUnit u) Source #

Create a hole Module

isHoleModule :: GenModule (GenUnit u) -> Bool Source #

Test if a Module is not instantiated

stableModuleCmp :: Module -> Module -> Ordering Source #

This gives a stable ordering, as opposed to the Ord instance which gives an ordering based on the Uniques of the components, which may not be stable from run to run of the compiler.

moduleStableString :: Module -> String Source #

Get a string representation of a Module that's unique and stable across recompilations. eg. "$aeson_70dylHtv1FFGeai1IoxcQr$Data.Aeson.Types.Internal"

moduleIsDefinite :: Module -> Bool Source #

A Module is definite if it has no free holes.

class HasModule (m :: Type -> Type) where Source #

Methods

getModule :: m Module Source #

Instances

Instances details
HasModule NatM Source # 
Instance details

Defined in GHC.CmmToAsm.Monad

HasModule CoreM Source # 
Instance details

Defined in GHC.Core.Opt.Monad

HasModule TcS Source # 
Instance details

Defined in GHC.Tc.Solver.Monad

ContainsModule env => HasModule (IOEnv env) Source # 
Instance details

Defined in GHC.Data.IOEnv

Methods

getModule :: IOEnv env Module Source #

class ContainsModule t where Source #

Methods

extractModule :: t -> Module Source #

Instances

Instances details
ContainsModule DsGblEnv Source # 
Instance details

Defined in GHC.HsToCore.Types

ContainsModule TcGblEnv Source # 
Instance details

Defined in GHC.Tc.Types

ContainsModule gbl => ContainsModule (Env gbl lcl) Source # 
Instance details

Defined in GHC.Tc.Types

Methods

extractModule :: Env gbl lcl -> Module Source #

installedModuleEq :: InstalledModule -> Module -> Bool Source #

Test if a Module corresponds to a given InstalledModule, modulo instantiation.