TcBackpack

ghc-8.10.7: The GHC API

Safe Haskell | None
Language | Haskell2010

TcBackpack

Synopsis

- findExtraSigImports' :: HscEnv -> HscSource -> ModuleName -> IO (UniqDSet ModuleName)
- findExtraSigImports :: HscEnv -> HscSource -> ModuleName -> IO [(Maybe FastString, Located ModuleName)]
- implicitRequirements' :: HscEnv -> [(Maybe FastString, Located ModuleName)] -> IO [ModuleName]
- implicitRequirements :: HscEnv -> [(Maybe FastString, Located ModuleName)] -> IO [(Maybe FastString, Located ModuleName)]
- checkUnitId :: UnitId -> TcM ()
- tcRnCheckUnitId :: HscEnv -> UnitId -> IO (Messages, Maybe ())
- tcRnMergeSignatures :: HscEnv -> HsParsedModule -> TcGblEnv -> ModIface -> IO (Messages, Maybe TcGblEnv)
- mergeSignatures :: HsParsedModule -> TcGblEnv -> ModIface -> TcRn TcGblEnv
- tcRnInstantiateSignature :: HscEnv -> Module -> RealSrcSpan -> IO (Messages, Maybe TcGblEnv)
- instantiateSignature :: TcRn TcGblEnv

# Documentation

findExtraSigImports' :: HscEnv -> HscSource -> ModuleName -> IO (UniqDSet ModuleName) #

For a module `modname` of type `HscSource`, determine the list of extra "imports" of other requirements which should be considered part of the import of the requirement, because it transitively depends on those requirements by imports of modules from other packages. The situation is something like this:

unit p where signature A signature B import A

unit q where dependency p[A=A,B=B] signature A signature B

Although q's B does not directly import A, we still have to make sure we process A first, because the merging process will cause B to indirectly import A. This function finds the TRANSITIVE closure of all such imports we need to make.

findExtraSigImports :: HscEnv -> HscSource -> ModuleName -> IO [(Maybe FastString, Located ModuleName)] #

`findExtraSigImports`, but in a convenient form for GhcMake and TcRnDriver.

implicitRequirements' :: HscEnv -> [(Maybe FastString, Located ModuleName)] -> IO [ModuleName] #

implicitRequirements :: HscEnv -> [(Maybe FastString, Located ModuleName)] -> IO [(Maybe FastString, Located ModuleName)] #

checkUnitId :: UnitId -> TcM () #

Given a `UnitId`, make sure it is well typed. This is because unit IDs come from Cabal, which does not know if things are well-typed or not; a component may have been filled with implementations for the holes that don't actually fulfill the requirements.

INVARIANT: the UnitId is NOT a InstalledUnitId

tcRnCheckUnitId :: HscEnv -> UnitId -> IO (Messages, Maybe ()) #

Top-level driver for signature instantiation (run when compiling an `hsig` file.)

tcRnMergeSignatures :: HscEnv -> HsParsedModule -> TcGblEnv -> ModIface -> IO (Messages, Maybe TcGblEnv) #

Top-level driver for signature merging (run after typechecking an `hsig` file).

mergeSignatures :: HsParsedModule -> TcGblEnv -> ModIface -> TcRn TcGblEnv #

Given a local `ModIface`, merge all inherited requirements from `requirementMerges` into this signature, producing a final `TcGblEnv` that matches the local signature and all required signatures.

tcRnInstantiateSignature :: HscEnv -> Module -> RealSrcSpan -> IO (Messages, Maybe TcGblEnv) #

Top-level driver for signature instantiation (run when compiling an `hsig` file.)

instantiateSignature :: TcRn TcGblEnv #

Given `tcg_mod`, instantiate a `ModIface` from the indefinite library to use the actual implementations of the relevant entities, checking that the implementation matches the signature.