ghc-9.6.0.20230210: The GHC API
Safe HaskellSafe-Inferred
LanguageHaskell2010

GHC.Iface.Load

Description

Loading interface files

Synopsis

Documentation

loadModuleInterface :: SDoc -> Module -> TcM ModIface Source #

Load interface directly for a fully qualified GenModule. (This is a fairly rare operation, but in particular it is used to load orphan modules in order to pull their instances into the global package table and to handle some operations in GHCi).

loadModuleInterfaces :: SDoc -> [Module] -> TcM () Source #

Load interfaces for a collection of modules.

loadSrcInterface :: SDoc -> ModuleName -> IsBootInterface -> PkgQual -> RnM ModIface Source #

Load the interface corresponding to an import directive in source code. On a failure, fail in the monad with an error message.

loadInterfaceForName :: SDoc -> Name -> TcRn ModIface Source #

Loads the interface for a given Name. Should only be called for an imported name; otherwise loadSysInterface may not find the interface

loadInterfaceForModule :: SDoc -> Module -> TcRn ModIface Source #

Loads the interface for a given Module.

loadSysInterface :: SDoc -> Module -> IfM lcl ModIface Source #

Loads a system interface and throws an exception if it fails

loadUserInterface :: IsBootInterface -> SDoc -> Module -> IfM lcl ModIface Source #

Loads a user interface and throws an exception if it fails. The first parameter indicates whether we should import the boot variant of the module

findAndReadIface Source #

Arguments

:: HscEnv 
-> SDoc

Reason for loading the iface (used for tracing)

-> InstalledModule

The unique identifier of the on-disk module we're looking for

-> Module

The *actual* module we're looking for. We use this to check the consistency of the requirements of the module we read out.

-> IsBootInterface

Looking for .hi-boot or .hi file

-> IO (MaybeErr SDoc (ModIface, FilePath)) 

readIface :: DynFlags -> NameCache -> Module -> FilePath -> IO (MaybeErr SDoc ModIface) Source #

readIface tries just the one file.

Failed err = file not found, or unreadable, or illegible Succeeded iface = successfully found and parsed

writeIface :: Logger -> Profile -> FilePath -> ModIface -> IO () Source #

Write interface file

moduleFreeHolesPrecise :: SDoc -> Module -> TcRnIf gbl lcl (MaybeErr SDoc (UniqDSet ModuleName)) Source #

Compute the signatures which must be compiled in order to load the interface for a GenModule. The output of this function is always a subset of moduleFreeHoles; it is more precise because in signature p[A=<A>,B=<B>]:B, although the free holes are A and B, B might not depend on A at all!

If this is invoked on a signature, this does NOT include the signature itself; e.g. precise free module holes of p[A=<A>,B=<B>]:B never includes B.

loadWiredInHomeIface :: Name -> IfM lcl () Source #

An IfM function to load the home interface for a wired-in thing, so that we're sure that we see its instance declarations and rules See Note [Loading instances for wired-in things]

pprModIfaceSimple :: UnitState -> ModIface -> SDoc Source #

Show a ModIface but don't display details; suitable for ModIfaces stored in the EPT.

pprModIface :: UnitState -> ModIface -> SDoc Source #

Show a ModIface

The UnitState is used to pretty-print units

showIface :: Logger -> DynFlags -> UnitState -> NameCache -> FilePath -> IO () Source #

Read binary interface, and print it out

Orphan instances

Outputable (Warnings pass) Source # 
Instance details

Methods

ppr :: Warnings pass -> SDoc Source #