ghc-8.0.2: The GHC API

Safe HaskellNone
LanguageHaskell2010

TcMType

Synopsis

Documentation

newOpenFlexiTyVarTy :: TcM TcType Source #

Create a tyvar that can be a lifted or unlifted type.

data ExpType Source #

An expected type to check against during type-checking. See Note [ExpType] in TcMType, where you'll also find manipulators.

mkCheckExpType :: TcType -> ExpType Source #

Make an ExpType suitable for checking.

newOpenInferExpType :: TcM ExpType Source #

Make an ExpType suitable for inferring a type of kind * or #.

readExpType :: ExpType -> TcM TcType Source #

Extract a type out of an ExpType. Otherwise, panics.

readExpType_maybe :: ExpType -> TcM (Maybe TcType) Source #

Extract a type out of an ExpType, if one exists. But one should always exist. Unless you're quite sure you know what you're doing.

writeExpType :: ExpType -> TcType -> TcM () Source #

Write into an ExpType. It must be an Infer.

expTypeToType :: ExpType -> TcM TcType Source #

Extracts the expected type if there is one, or generates a new TauTv if there isn't.

checkingExpType_maybe :: ExpType -> Maybe TcType Source #

Returns the expected type when in checking mode.

checkingExpType :: String -> ExpType -> TcType Source #

Returns the expected type when in checking mode. Panics if in inference mode.

tauifyExpType :: ExpType -> TcM ExpType Source #

Turn a (Infer hole) type into a (Check alpha), where alpha is a fresh unificaiton variable

emitWanted :: CtOrigin -> TcPredType -> TcM EvTerm Source #

Emits a new Wanted. Deals with both equalities and non-equalities.

emitWantedEq :: CtOrigin -> TypeOrKind -> Role -> TcType -> TcType -> TcM Coercion Source #

Emits a new equality constraint

emitWantedEvVar :: CtOrigin -> TcPredType -> TcM EvVar Source #

Creates a new EvVar and immediately emits it as a Wanted. No equality predicates here.

fillCoercionHole :: CoercionHole -> Coercion -> TcM () Source #

Put a value in a coercion hole

isFilledCoercionHole :: CoercionHole -> TcM Bool Source #

Is a coercion hole filled in?

unpackCoercionHole :: CoercionHole -> TcM Coercion Source #

Retrieve the contents of a coercion hole. Panics if the hole is unfilled

unpackCoercionHole_maybe :: CoercionHole -> TcM (Maybe Coercion) Source #

Retrieve the contents of a coercion hole, if it is filled

checkCoercionHole :: Coercion -> CoercionHole -> Role -> Type -> Type -> TcM Coercion Source #

Check that a coercion is appropriate for filling a hole. (The hole itself is needed only for printing. NB: This must be lazy in the coercion, as it's used in TcHsSyn in the presence of knots. Always returns the checked coercion, but this return value is necessary so that the input coercion is forced only when the output is forced.

tcInstType Source #

Arguments

:: ([TyVar] -> TcM (TCvSubst, [TcTyVar]))

How to instantiate the type variables

-> TcType

Type to instantiate

-> TcM ([TcTyVar], TcThetaType, TcType)

Result (type vars, preds (incl equalities), rho)

freshenTyVarBndrs :: [TyVar] -> TcRnIf gbl lcl (TCvSubst, [TyVar]) Source #

Give fresh uniques to a bunch of TyVars, but they stay as TyVars, rather than becoming TcTyVars Used in FamInst.newFamInst, and Inst.newClsInst

freshenCoVarBndrsX :: TCvSubst -> [CoVar] -> TcRnIf gbl lcl (TCvSubst, [CoVar]) Source #

Give fresh uniques to a bunch of CoVars Used in FamInst.newFamInst

mkTypeErrorThing :: TcType -> ErrorThing Source #

Make an ErrorThing storing a type.

mkTypeErrorThingArgs :: TcType -> Int -> ErrorThing Source #

Make an ErrorThing storing a type, with some extra args known about

zonkTcTypeAndSplitDepVars :: TcType -> TcM TcDepVars Source #

Zonk a type and call splitDepVarsOfType on it. Works within the knot.

zonkQuantifiedTyVarOrType :: TcTyVar -> TcM (Either TcTyVar TcType) Source #

Like zonkQuantifiedTyVar, but if zonking reveals that the tyvar should become a type (when defaulting a RuntimeRep var to PtrRepLifted), it returns the type instead.

defaultKindVar :: TcTyVar -> TcM Kind Source #

Take an (unconstrained) meta tyvar and default it. Works only on vars of type RuntimeRep and of type *. For other kinds, it issues an error. See Note [Defaulting with -XNoPolyKinds]

zonkCo :: Coercion -> TcM Coercion Source #

Zonk a coercion -- really, just zonk any types in the coercion

zonkTcTypeMapper :: TyCoMapper () TcM Source #

A suitable TyCoMapper for zonking a type inside the knot, and before all metavars are filled in.

tcGetGlobalTyCoVars :: TcM TcTyVarSet Source #

tcGetGlobalTyCoVars returns a fully-zonked set of *scoped* tyvars free in the environment. To improve subsequent calls to the same function it writes the zonked set back into the environment. Note that this returns all variables free in anything (term-level or type-level) in scope. We thus don't have to worry about clashes with things that are not in scope, because if they are reachable, then they'll be returned here.