Safe Haskell | None |
---|---|
Language | Haskell2010 |
TcMType
- type TcTyVar = TyVar
- type TcKind = Kind
- type TcType = Type
- type TcTauType = TcType
- type TcThetaType = ThetaType
- type TcTyVarSet = TyVarSet
- newFlexiTyVar :: Kind -> TcM TcTyVar
- newFlexiTyVarTy :: Kind -> TcM TcType
- newFlexiTyVarTys :: Int -> Kind -> TcM [TcType]
- newOpenFlexiTyVarTy :: TcM TcType
- newReturnTyVar :: Kind -> TcM TcTyVar
- newReturnTyVarTy :: Kind -> TcM TcType
- newOpenReturnTyVar :: TcM (TcTyVar, TcKind)
- newMetaKindVar :: TcM TcKind
- newMetaKindVars :: Int -> TcM [TcKind]
- cloneMetaTyVar :: TcTyVar -> TcM TcTyVar
- newFmvTyVar :: TcType -> TcM TcTyVar
- newFskTyVar :: TcType -> TcM TcTyVar
- tauTvForReturnTv :: TcType -> TcM TcType
- readMetaTyVar :: TyVar -> TcM MetaDetails
- writeMetaTyVar :: TcTyVar -> TcType -> TcM ()
- writeMetaTyVarRef :: TcTyVar -> TcRef MetaDetails -> TcType -> TcM ()
- newMetaDetails :: MetaInfo -> TcM TcTyVarDetails
- isFilledMetaTyVar :: TyVar -> TcM Bool
- isUnfilledMetaTyVar :: TyVar -> TcM Bool
- genInstSkolTyVarsX :: SrcSpan -> TCvSubst -> [TyVar] -> TcRnIf gbl lcl (TCvSubst, [TcTyVar])
- newEvVar :: TcPredType -> TcRnIf gbl lcl EvVar
- newEvVars :: TcThetaType -> TcM [EvVar]
- newDict :: Class -> [TcType] -> TcM DictId
- newWanted :: CtOrigin -> Maybe TypeOrKind -> PredType -> TcM CtEvidence
- newWanteds :: CtOrigin -> ThetaType -> TcM [CtEvidence]
- emitWanted :: CtOrigin -> TcPredType -> TcM EvTerm
- emitWantedEq :: CtOrigin -> TypeOrKind -> Role -> TcType -> TcType -> TcM Coercion
- emitWantedEvVar :: CtOrigin -> TcPredType -> TcM EvVar
- emitWantedEvVars :: CtOrigin -> [TcPredType] -> TcM [EvVar]
- newTcEvBinds :: TcM EvBindsVar
- addTcEvBind :: EvBindsVar -> EvBind -> TcM ()
- newCoercionHole :: TcM CoercionHole
- fillCoercionHole :: CoercionHole -> Coercion -> TcM ()
- isFilledCoercionHole :: CoercionHole -> TcM Bool
- unpackCoercionHole :: CoercionHole -> TcM Coercion
- unpackCoercionHole_maybe :: CoercionHole -> TcM (Maybe Coercion)
- checkCoercionHole :: Coercion -> CoercionHole -> Role -> Type -> Type -> TcM Coercion
- newMetaTyVars :: [TyVar] -> TcM (TCvSubst, [TcTyVar])
- newMetaTyVarX :: TCvSubst -> TyVar -> TcM (TCvSubst, TcTyVar)
- newMetaSigTyVars :: [TyVar] -> TcM (TCvSubst, [TcTyVar])
- newSigTyVar :: Name -> Kind -> TcM TcTyVar
- tcInstType :: ([TyVar] -> TcM (TCvSubst, [TcTyVar])) -> TcType -> TcM ([TcTyVar], TcThetaType, TcType)
- tcInstSkolTyVars :: [TyVar] -> TcM (TCvSubst, [TcTyVar])
- tcInstSkolTyVarsLoc :: SrcSpan -> [TyVar] -> TcRnIf gbl lcl (TCvSubst, [TcTyVar])
- tcInstSuperSkolTyVarsX :: TCvSubst -> [TyVar] -> TcM (TCvSubst, [TcTyVar])
- tcInstSigTyVarsLoc :: SrcSpan -> [TyVar] -> TcRnIf gbl lcl (TCvSubst, [TcTyVar])
- tcInstSigTyVars :: [TyVar] -> TcRnIf gbl lcl (TCvSubst, [TcTyVar])
- tcInstSkolType :: TcType -> TcM ([TcTyVar], TcThetaType, TcType)
- tcSkolDFunType :: Type -> TcM ([TcTyVar], TcThetaType, TcType)
- tcSuperSkolTyVars :: [TyVar] -> (TCvSubst, [TcTyVar])
- instSkolTyCoVars :: (Unique -> Name -> Kind -> TyCoVar) -> [TyVar] -> TcRnIf gbl lcl (TCvSubst, [TyCoVar])
- freshenTyVarBndrs :: [TyVar] -> TcRnIf gbl lcl (TCvSubst, [TyVar])
- freshenCoVarBndrsX :: TCvSubst -> [CoVar] -> TcRnIf gbl lcl (TCvSubst, [CoVar])
- zonkTidyTcType :: TidyEnv -> TcType -> TcM (TidyEnv, TcType)
- zonkTidyOrigin :: TidyEnv -> CtOrigin -> TcM (TidyEnv, CtOrigin)
- mkTypeErrorThing :: TcType -> ErrorThing
- mkTypeErrorThingArgs :: TcType -> Int -> ErrorThing
- tidyEvVar :: TidyEnv -> EvVar -> EvVar
- tidyCt :: TidyEnv -> Ct -> Ct
- tidySkolemInfo :: TidyEnv -> SkolemInfo -> (TidyEnv, SkolemInfo)
- skolemiseUnboundMetaTyVar :: TcTyVar -> TcTyVarDetails -> TcM TyVar
- zonkTcTyVar :: TcTyVar -> TcM TcType
- zonkTcTyVars :: [TcTyVar] -> TcM [TcType]
- zonkTyCoVarsAndFV :: TyCoVarSet -> TcM TyCoVarSet
- zonkTcTypeAndFV :: TcType -> TcM TyCoVarSet
- zonkQuantifiedTyVar :: TcTyVar -> TcM (Maybe TcTyVar)
- zonkQuantifiedTyVarOrType :: TcTyVar -> TcM (Either TcTyVar TcType)
- quantifyTyVars :: TcTyCoVarSet -> Pair TcTyCoVarSet -> TcM [TcTyVar]
- defaultKindVar :: TcTyVar -> TcM Kind
- zonkTcTyCoVarBndr :: TcTyCoVar -> TcM TcTyCoVar
- zonkTcType :: TcType -> TcM TcType
- zonkTcTypes :: [TcType] -> TcM [TcType]
- zonkCo :: Coercion -> TcM Coercion
- zonkTyCoVarKind :: TyCoVar -> TcM TyCoVar
- zonkTcTypeMapper :: TyCoMapper () TcM
- zonkEvVar :: EvVar -> TcM EvVar
- zonkWC :: WantedConstraints -> TcM WantedConstraints
- zonkSimples :: Cts -> TcM Cts
- zonkId :: TcId -> TcM TcId
- zonkCt :: Ct -> TcM Ct
- zonkSkolemInfo :: SkolemInfo -> TcM SkolemInfo
- tcGetGlobalTyCoVars :: TcM TcTyVarSet
Documentation
type TcThetaType = ThetaType
type TcTyVarSet = TyVarSet
newFlexiTyVar :: Kind -> TcM TcTyVar
newFlexiTyVarTy :: Kind -> TcM TcType
newFlexiTyVarTys :: Int -> Kind -> TcM [TcType]
newOpenFlexiTyVarTy :: TcM TcType
Create a tyvar that can be a lifted or unlifted type.
newReturnTyVar :: Kind -> TcM TcTyVar
newReturnTyVarTy :: Kind -> TcM TcType
newOpenReturnTyVar :: TcM (TcTyVar, TcKind)
Create a *return* tyvar that can be a lifted or unlifted type.
newMetaKindVars :: Int -> TcM [TcKind]
cloneMetaTyVar :: TcTyVar -> TcM TcTyVar
newFmvTyVar :: TcType -> TcM TcTyVar
newFskTyVar :: TcType -> TcM TcTyVar
tauTvForReturnTv :: TcType -> TcM TcType
If the type is a ReturnTv, fill it with a new meta-TauTv. Otherwise, no change. This function can look through ReturnTvs and returns a partially zonked type as an optimisation.
readMetaTyVar :: TyVar -> TcM MetaDetails
writeMetaTyVar :: TcTyVar -> TcType -> TcM ()
writeMetaTyVarRef :: TcTyVar -> TcRef MetaDetails -> TcType -> TcM ()
isFilledMetaTyVar :: TyVar -> TcM Bool
isUnfilledMetaTyVar :: TyVar -> TcM Bool
newEvVar :: TcPredType -> TcRnIf gbl lcl EvVar
newEvVars :: TcThetaType -> TcM [EvVar]
newWanted :: CtOrigin -> Maybe TypeOrKind -> PredType -> TcM CtEvidence
newWanteds :: CtOrigin -> ThetaType -> TcM [CtEvidence]
emitWanted :: CtOrigin -> TcPredType -> TcM EvTerm
Emits a new Wanted. Deals with both equalities and non-equalities.
emitWantedEq :: CtOrigin -> TypeOrKind -> Role -> TcType -> TcType -> TcM Coercion
Emits a new equality constraint
emitWantedEvVar :: CtOrigin -> TcPredType -> TcM EvVar
Creates a new EvVar and immediately emits it as a Wanted. No equality predicates here.
emitWantedEvVars :: CtOrigin -> [TcPredType] -> TcM [EvVar]
addTcEvBind :: EvBindsVar -> EvBind -> TcM ()
fillCoercionHole :: CoercionHole -> Coercion -> TcM ()
Put a value in a coercion hole
isFilledCoercionHole :: CoercionHole -> TcM Bool
Is a coercion hole filled in?
unpackCoercionHole :: CoercionHole -> TcM Coercion
Retrieve the contents of a coercion hole. Panics if the hole is unfilled
unpackCoercionHole_maybe :: CoercionHole -> TcM (Maybe Coercion)
Retrieve the contents of a coercion hole, if it is filled
checkCoercionHole :: Coercion -> CoercionHole -> Role -> Type -> Type -> TcM Coercion
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.
newMetaTyVars :: [TyVar] -> TcM (TCvSubst, [TcTyVar])
newMetaSigTyVars :: [TyVar] -> TcM (TCvSubst, [TcTyVar])
newSigTyVar :: Name -> Kind -> TcM TcTyVar
tcInstSkolTyVars :: [TyVar] -> TcM (TCvSubst, [TcTyVar])
tcInstSigTyVars :: [TyVar] -> TcRnIf gbl lcl (TCvSubst, [TcTyVar])
tcInstSkolType :: TcType -> TcM ([TcTyVar], TcThetaType, TcType)
tcSkolDFunType :: Type -> TcM ([TcTyVar], TcThetaType, TcType)
tcSuperSkolTyVars :: [TyVar] -> (TCvSubst, [TcTyVar])
instSkolTyCoVars :: (Unique -> Name -> Kind -> TyCoVar) -> [TyVar] -> TcRnIf gbl lcl (TCvSubst, [TyCoVar])
freshenTyVarBndrs :: [TyVar] -> TcRnIf gbl lcl (TCvSubst, [TyVar])
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])
Give fresh uniques to a bunch of CoVars Used in FamInst.newFamInst
mkTypeErrorThing :: TcType -> ErrorThing
Make an ErrorThing
storing a type.
mkTypeErrorThingArgs :: TcType -> Int -> ErrorThing
Make an ErrorThing
storing a type, with some extra args known about
tidySkolemInfo :: TidyEnv -> SkolemInfo -> (TidyEnv, SkolemInfo)
zonkTcTyVar :: TcTyVar -> TcM TcType
zonkTcTyVars :: [TcTyVar] -> TcM [TcType]
zonkTcTypeAndFV :: TcType -> TcM TyCoVarSet
zonkQuantifiedTyVar :: TcTyVar -> TcM (Maybe TcTyVar)
zonkQuantifiedTyVarOrType :: TcTyVar -> TcM (Either TcTyVar TcType)
Like zonkQuantifiedTyVar, but if zonking reveals that the tyvar should become a type (when defaulting a levity var to Lifted), it returns the type instead.
quantifyTyVars :: TcTyCoVarSet -> Pair TcTyCoVarSet -> TcM [TcTyVar]
defaultKindVar :: TcTyVar -> TcM Kind
Take an (unconstrained) meta tyvar and default it. Works only for kind vars (of type BOX) and levity vars (of type Levity).
zonkTcType :: TcType -> TcM TcType
zonkTcTypes :: [TcType] -> TcM [TcType]
zonkTyCoVarKind :: TyCoVar -> TcM TyCoVar
zonkTcTypeMapper :: TyCoMapper () TcM
A suitable TyCoMapper for zonking a type inside the knot, and before all metavars are filled in.
zonkSimples :: Cts -> TcM Cts
tcGetGlobalTyCoVars :: TcM TcTyVarSet
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.