Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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)]
- implicitRequirementsShallow :: HscEnv -> [(Maybe FastString, Located ModuleName)] -> IO ([ModuleName], [InstantiatedUnit])
- checkUnit :: Unit -> TcM ()
- tcRnCheckUnit :: HscEnv -> Unit -> IO (Messages DecoratedSDoc, Maybe ())
- tcRnMergeSignatures :: HscEnv -> HsParsedModule -> TcGblEnv -> ModIface -> IO (Messages DecoratedSDoc, Maybe TcGblEnv)
- mergeSignatures :: HsParsedModule -> TcGblEnv -> ModIface -> TcRn TcGblEnv
- tcRnInstantiateSignature :: HscEnv -> Module -> RealSrcSpan -> IO (Messages DecoratedSDoc, Maybe TcGblEnv)
- instantiateSignature :: TcRn TcGblEnv
Documentation
findExtraSigImports' :: HscEnv -> HscSource -> ModuleName -> IO (UniqDSet ModuleName) Source #
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 X signature Y import X
unit q where dependency p[X=<A>,Y=<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)] Source #
findExtraSigImports
, but in a convenient form for GHC.Driver.Make and
GHC.Tc.Module.
implicitRequirements' :: HscEnv -> [(Maybe FastString, Located ModuleName)] -> IO [ModuleName] Source #
implicitRequirements :: HscEnv -> [(Maybe FastString, Located ModuleName)] -> IO [(Maybe FastString, Located ModuleName)] Source #
implicitRequirementsShallow :: HscEnv -> [(Maybe FastString, Located ModuleName)] -> IO ([ModuleName], [InstantiatedUnit]) Source #
Like implicitRequirements'
, but returns either the module name, if it is
a free hole, or the instantiated unit the imported module is from, so that
that instantiated unit can be processed and via the batch mod graph (rather
than a transitive closure done here) all the free holes are still reachable.
checkUnit :: Unit -> TcM () Source #
Given a Unit
, 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.
tcRnCheckUnit :: HscEnv -> Unit -> IO (Messages DecoratedSDoc, Maybe ()) Source #
Top-level driver for signature instantiation (run when compiling
an hsig
file.)
tcRnMergeSignatures :: HscEnv -> HsParsedModule -> TcGblEnv -> ModIface -> IO (Messages DecoratedSDoc, Maybe TcGblEnv) Source #
Top-level driver for signature merging (run after typechecking
an hsig
file).
mergeSignatures :: HsParsedModule -> TcGblEnv -> ModIface -> TcRn TcGblEnv Source #
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 DecoratedSDoc, Maybe TcGblEnv) Source #
Top-level driver for signature instantiation (run when compiling
an hsig
file.)