| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
GHC.Tc.Zonk.TcType
Description
Zonking types within the typechecker.
Distinct from the final zonking pass in GHC.Tc.Zonk.Type; see Note [Module structure for zonking] in GHC.Tc.Zonk.Type.
Synopsis
- module GHC.Tc.Zonk.Monad
- zonkTcType :: TcType -> ZonkM TcType
- zonkTcTypes :: [TcType] -> ZonkM [TcType]
- zonkScaledTcType :: Scaled TcType -> ZonkM (Scaled TcType)
- zonkTcTyVar :: TcTyVar -> ZonkM TcType
- zonkTcTyVars :: [TcTyVar] -> ZonkM [TcType]
- zonkTcTyVarToTcTyVar :: HasDebugCallStack => TcTyVar -> ZonkM TcTyVar
- zonkTcTyVarsToTcTyVars :: HasDebugCallStack => [TcTyVar] -> ZonkM [TcTyVar]
- zonkInvisTVBinder :: VarBndr TcTyVar spec -> ZonkM (VarBndr TcTyVar spec)
- zonkCo :: Coercion -> ZonkM Coercion
- zonkTcTyCon :: TcTyCon -> ZonkM TcTyCon
- zonkTcTypeAndFV :: TcType -> ZonkM DTyCoVarSet
- zonkTyCoVarsAndFV :: TyCoVarSet -> ZonkM TyCoVarSet
- zonkTyCoVarsAndFVList :: [TyCoVar] -> ZonkM [TyCoVar]
- zonkDTyCoVarSetAndFV :: DTyCoVarSet -> ZonkM DTyCoVarSet
- zonkId :: TcId -> ZonkM TcId
- zonkCoVar :: CoVar -> ZonkM CoVar
- zonkTyCoVar :: TyCoVar -> ZonkM TcType
- zonkTyCoVarKind :: TyCoVar -> ZonkM TyCoVar
- zonkTyCoVarBndrKind :: VarBndr TyCoVar flag -> ZonkM (VarBndr TyCoVar flag)
- zonkSkolemInfo :: SkolemInfo -> ZonkM SkolemInfo
- zonkSkolemInfoAnon :: SkolemInfoAnon -> ZonkM SkolemInfoAnon
- zonkCt :: Ct -> ZonkM Ct
- zonkWC :: WantedConstraints -> ZonkM WantedConstraints
- zonkSimples :: Cts -> ZonkM Cts
- zonkImplication :: Implication -> ZonkM Implication
- zonkRewriterSet :: RewriterSet -> ZonkM RewriterSet
- zonkCtRewriterSet :: Ct -> ZonkM Ct
- zonkCtEvRewriterSet :: CtEvidence -> ZonkM CtEvidence
- isFilledCoercionHole :: CoercionHole -> ZonkM Bool
- unpackCoercionHole :: CoercionHole -> ZonkM Coercion
- unpackCoercionHole_maybe :: CoercionHole -> ZonkM (Maybe Coercion)
- tcInitTidyEnv :: ZonkM TidyEnv
- tcInitOpenTidyEnv :: [TyCoVar] -> ZonkM TidyEnv
- tidyCt :: TidyEnv -> Ct -> Ct
- tidyEvVar :: TidyEnv -> EvVar -> EvVar
- tidyDelayedError :: TidyEnv -> DelayedError -> DelayedError
- zonkTidyTcType :: TidyEnv -> TcType -> ZonkM (TidyEnv, TcType)
- zonkTidyTcTypes :: TidyEnv -> [TcType] -> ZonkM (TidyEnv, [TcType])
- zonkTidyOrigin :: TidyEnv -> CtOrigin -> ZonkM (TidyEnv, CtOrigin)
- zonkTidyOrigins :: TidyEnv -> [CtOrigin] -> ZonkM (TidyEnv, [CtOrigin])
- zonkTidyFRRInfos :: TidyEnv -> [FixedRuntimeRepErrorInfo] -> ZonkM (TidyEnv, [FixedRuntimeRepErrorInfo])
- writeMetaTyVar :: HasDebugCallStack => TcTyVar -> TcType -> ZonkM ()
- writeMetaTyVarRef :: HasDebugCallStack => TcTyVar -> TcRef MetaDetails -> TcType -> ZonkM ()
- checkCoercionHole :: CoVar -> Coercion -> ZonkM Coercion
Zonking (within the typechecker)
The ZonkM monad and ZonkGblEnv
module GHC.Tc.Zonk.Monad
Zonking types
zonkTcType :: TcType -> ZonkM TcType #
zonkTcTypes :: [TcType] -> ZonkM [TcType] #
zonkTcTyVar :: TcTyVar -> ZonkM TcType #
zonkTcTyVars :: [TcTyVar] -> ZonkM [TcType] #
zonkTcTyVarsToTcTyVars :: HasDebugCallStack => [TcTyVar] -> ZonkM [TcTyVar] #
Zonking TyCons
zonkTcTyCon :: TcTyCon -> ZonkM TcTyCon #
FreeVars
zonkTcTypeAndFV :: TcType -> ZonkM DTyCoVarSet #
zonkTyCoVarsAndFVList :: [TyCoVar] -> ZonkM [TyCoVar] #
Zonking CoVars and Ids
zonkTyCoVar :: TyCoVar -> ZonkM TcType #
zonkTyCoVarKind :: TyCoVar -> ZonkM TyCoVar #
Zonking skolem info
zonkSkolemInfo :: SkolemInfo -> ZonkM SkolemInfo #
Zonking constraints
zonkSimples :: Cts -> ZonkM Cts #
Rewriter sets
zonkRewriterSet :: RewriterSet -> ZonkM RewriterSet #
Zonk a rewriter set; if a coercion hole in the set has been filled, find all the free un-filled coercion holes in the coercion that fills it
zonkCtRewriterSet :: Ct -> ZonkM Ct #
Coercion holes
isFilledCoercionHole :: CoercionHole -> ZonkM Bool #
Is a coercion hole filled in?
unpackCoercionHole :: CoercionHole -> ZonkM Coercion #
Retrieve the contents of a coercion hole. Panics if the hole is unfilled
unpackCoercionHole_maybe :: CoercionHole -> ZonkM (Maybe Coercion) #
Retrieve the contents of a coercion hole, if it is filled
Tidying
tcInitOpenTidyEnv :: [TyCoVar] -> ZonkM TidyEnv #
Get a TidyEnv that includes mappings for all vars free in the given
type. Useful when tidying open types.
tidyDelayedError :: TidyEnv -> DelayedError -> DelayedError #
Zonk & tidy
zonkTidyFRRInfos :: TidyEnv -> [FixedRuntimeRepErrorInfo] -> ZonkM (TidyEnv, [FixedRuntimeRepErrorInfo]) #
Writing to metavariables
Arguments
| :: HasDebugCallStack | |
| => TcTyVar | the type varfiable to write to |
| -> TcType | the type to write into the mutable reference |
| -> ZonkM () |
Write into a currently-empty MetaTyVar.
Works with both type and kind variables.
Arguments
| :: HasDebugCallStack | |
| => TcTyVar | for debug assertions only; |
| -> TcRef MetaDetails | ref cell must be for the same tyvar |
| -> TcType | the type to write to the mutable reference |
| -> ZonkM () |
Write into the MetaDetails mutable references of a MetaTv.
Handling coercion holes
checkCoercionHole :: CoVar -> Coercion -> ZonkM Coercion #
Debugging-only! Check that a coercion is appropriate for filling a hole. (The hole itself is needed only for printing.)
Always returns the checked coercion, but this return value is necessary so that the input coercion is forced only when the output is forced.