ghc-lib-0.20201101: The GHC API, decoupled from GHC versions
Safe HaskellNone
LanguageHaskell2010

GHC.Tc.Module

Description

Synopsis

Documentation

tcRnStmt :: HscEnv -> GhciLStmt GhcPs -> IO (Messages, Maybe ([Id], LHsExpr GhcTc, FixityEnv)) Source #

The returned [Id] is the list of new Ids bound by this statement. It can be used to extend the InteractiveContext via extendInteractiveContext.

The returned TypecheckedHsExpr is of type IO [ () ], a list of the bound values, coerced to ().

tcRnExpr :: HscEnv -> TcRnExprMode -> LHsExpr GhcPs -> IO (Messages, Maybe Type) Source #

tcRnExpr just finds the type of an expression for :type

data TcRnExprMode Source #

How should we infer a type? See Note [TcRnExprMode]

Constructors

TM_Inst

Instantiate inferred quantifiers only (:type)

TM_Default

Instantiate all quantifiers, and do eager defaulting (:type +d)

tcRnType :: HscEnv -> ZonkFlexi -> Bool -> LHsType GhcPs -> IO (Messages, Maybe (Type, Kind)) Source #

tcRnImportDecls :: HscEnv -> [LImportDecl GhcPs] -> IO (Messages, Maybe GlobalRdrEnv) Source #

tcRnLookupRdrName :: HscEnv -> Located RdrName -> IO (Messages, Maybe [Name]) Source #

Find all the Names that this RdrName could mean, in GHCi

getModuleInterface :: HscEnv -> Module -> IO (Messages, Maybe ModIface) Source #

ASSUMES that the module is either in the HomePackageTable or is a package module with an interface on disk. If neither of these is true, then the result will be an error indicating the interface could not be found.

tcRnDeclsi :: HscEnv -> [LHsDecl GhcPs] -> IO (Messages, Maybe TcGblEnv) Source #

isGHCiMonad :: HscEnv -> String -> IO (Messages, Maybe Name) Source #

runTcInteractive :: HscEnv -> TcRn a -> IO (Messages, Maybe a) Source #

tcRnGetInfo :: HscEnv -> Name -> IO (Messages, Maybe (TyThing, Fixity, [ClsInst], [FamInst], SDoc)) Source #

tcRnModule :: HscEnv -> ModSummary -> Bool -> HsParsedModule -> IO (Messages, Maybe TcGblEnv) Source #

Top level entry point for typechecker and renamer

tcRnModuleTcRnM :: HscEnv -> ModSummary -> HsParsedModule -> (Module, SrcSpan) -> TcRn TcGblEnv Source #

tcTopSrcDecls :: HsGroup GhcRn -> TcM (TcGblEnv, TcLclEnv) Source #

rnTopSrcDecls :: HsGroup GhcPs -> TcM (TcGblEnv, HsGroup GhcRn) Source #

checkBootDecl :: Bool -> TyThing -> TyThing -> Maybe SDoc Source #

Compares the two things for equivalence between boot-file and normal code. Returns Nothing on success or Just "some helpful info for user" failure. If the difference will be apparent to the user, Just empty is perfectly suitable.

checkHiBootIface' :: [ClsInst] -> TypeEnv -> [AvailInfo] -> ModDetails -> TcM [(Id, Id)] Source #

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

findExtraSigImports, but in a convenient form for GHC.Driver.Make and GHC.Tc.Module.

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.

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.

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

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

instantiateSignature :: TcRn TcGblEnv Source #

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.

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

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

loadUnqualIfaces :: HscEnv -> InteractiveContext -> TcM () Source #

checkBootDeclM Source #

Arguments

:: Bool

True = an hs-boot file (could also be a sig)

-> TyThing 
-> TyThing 
-> TcM () 

Compares two things for equivalence between boot-file and normal code, reporting an error if they don't match up.

getRenamedStuff :: TcGblEnv -> RenamedStuff Source #

Extract the renamed information from TcGblEnv.

type RenamedStuff = Maybe (HsGroup GhcRn, [LImportDecl GhcRn], Maybe [(LIE GhcRn, Avails)], Maybe LHsDocString) Source #