ghc-8.4.3: The GHC API

TcRnDriver

Synopsis

# Documentation

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 just finds the type of an expression

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

Constructors

 TM_Inst Instantiate the type fully (:type) TM_NoInst Do not instantiate the type (:type +v) TM_Default Default the type eagerly (:type +d)

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

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.

Top level entry point for typechecker and renamer

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.

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

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

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.

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

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.

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

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.