GHC.Tc.Solver.Monad

ghc-9.10.0.20240413: The GHC API

Safe Haskell | None
Language | GHC2021

GHC.Tc.Solver.Monad

Description

Monadic definitions for the constraint solver

Synopsis

- data TcS a
- runTcS :: TcS a -> TcM (a, EvBindMap)
- runTcSEarlyAbort :: TcS a -> TcM a
- runTcSWithEvBinds :: EvBindsVar -> TcS a -> TcM a
- runTcSInerts :: InertSet -> TcS a -> TcM (a, InertSet)
- failTcS :: TcRnMessage -> TcS a
- warnTcS :: TcRnMessage -> TcS ()
- addErrTcS :: TcRnMessage -> TcS ()
- wrapTcS :: TcM a -> TcS a
- ctLocWarnTcS :: CtLoc -> TcRnMessage -> TcS ()
- runTcSEqualities :: TcS a -> TcM a
- nestTcS :: TcS a -> TcS a
- nestImplicTcS :: EvBindsVar -> TcLevel -> TcS a -> TcS a
- setEvBindsTcS :: EvBindsVar -> TcS a -> TcS a
- emitImplicationTcS :: TcLevel -> SkolemInfoAnon -> [TcTyVar] -> [EvVar] -> Cts -> TcS TcEvBinds
- emitTvImplicationTcS :: TcLevel -> SkolemInfoAnon -> [TcTyVar] -> Cts -> TcS ()
- emitFunDepWanteds :: CtEvidence -> [FunDepEqn (CtLoc, RewriterSet)] -> TcS Bool
- selectNextWorkItem :: TcS (Maybe Ct)
- getWorkList :: TcS WorkList
- updWorkListTcS :: (WorkList -> WorkList) -> TcS ()
- pushLevelNoWorkList :: SDoc -> TcS a -> TcS (TcLevel, a)
- runTcPluginTcS :: TcPluginM a -> TcS a
- recordUsedGREs :: Bag GlobalRdrElt -> TcS ()
- matchGlobalInst :: DynFlags -> Bool -> Class -> [Type] -> CtLoc -> TcS ClsInstResult
- data ClsInstResult
  - = NoInstance
  - | OneInst {
    - cir_new_theta :: [TcPredType]
    - cir_mk_ev :: [EvExpr] -> EvTerm
    - cir_canonical :: Canonical
    - cir_what :: InstanceWhat
    }
  - | NotSure
- data QCInst = QCI {
  - qci_ev :: CtEvidence
  - qci_tvs :: [TcTyVar]
  - qci_pred :: TcPredType
  - qci_pend_sc :: ExpansionFuel
  }
- data StopOrContinue a
  - = StartAgain Ct
  - | ContinueWith !a
  - | Stop CtEvidence SDoc
- continueWith :: a -> TcS (StopOrContinue a)
- stopWith :: CtEvidence -> String -> TcS (StopOrContinue a)
- startAgainWith :: Ct -> TcS (StopOrContinue a)
- newtype SolverStage a = Stage {
  - runSolverStage :: TcS (StopOrContinue a)
  }
- simpleStage :: TcS a -> SolverStage a
- stopWithStage :: CtEvidence -> String -> SolverStage a
- panicTcS :: SDoc -> TcS a
- traceTcS :: String -> SDoc -> TcS ()
- tryEarlyAbortTcS :: TcS ()
- traceFireTcS :: CtEvidence -> SDoc -> TcS ()
- bumpStepCountTcS :: TcS ()
- csTraceTcS :: SDoc -> TcS ()
- wrapErrTcS :: TcM a -> TcS a
- wrapWarnTcS :: TcM a -> TcS a
- resetUnificationFlag :: TcS Bool
- setUnificationFlag :: TcLevel -> TcS ()
- data MaybeNew
  - = Fresh CtEvidence
  - | Cached EvExpr
- freshGoals :: [MaybeNew] -> [CtEvidence]
- isFresh :: MaybeNew -> Bool
- getEvExpr :: MaybeNew -> EvExpr
- newTcEvBinds :: TcS EvBindsVar
- newNoTcEvBinds :: TcS EvBindsVar
- newWantedEq :: CtLoc -> RewriterSet -> Role -> TcType -> TcType -> TcS (CtEvidence, Coercion)
- emitNewWantedEq :: CtLoc -> RewriterSet -> Role -> TcType -> TcType -> TcS Coercion
- newWanted :: CtLoc -> RewriterSet -> PredType -> TcS MaybeNew
- newWantedNC :: CtLoc -> RewriterSet -> PredType -> TcS CtEvidence
- newWantedEvVarNC :: CtLoc -> RewriterSet -> TcPredType -> TcS CtEvidence
- newBoundEvVarId :: TcPredType -> EvTerm -> TcS EvVar
- unifyTyVar :: TcTyVar -> TcType -> TcS ()
- reportUnifications :: TcS a -> TcS (Int, a)
- touchabilityAndShapeTest :: TcLevel -> TcTyVar -> TcType -> Bool
- setEvBind :: EvBind -> TcS ()
- setWantedEq :: HasDebugCallStack => TcEvDest -> Coercion -> TcS ()
- setWantedEvTerm :: TcEvDest -> Canonical -> EvTerm -> TcS ()
- setEvBindIfWanted :: CtEvidence -> Canonical -> EvTerm -> TcS ()
- newEvVar :: TcPredType -> TcS EvVar
- newGivenEvVar :: CtLoc -> (TcPredType, EvTerm) -> TcS CtEvidence
- emitNewGivens :: CtLoc -> [(Role, TcType, TcType, TcCoercion)] -> TcS ()
- checkReductionDepth :: CtLoc -> TcType -> TcS ()
- getSolvedDicts :: TcS (DictMap DictCt)
- setSolvedDicts :: DictMap DictCt -> TcS ()
- getInstEnvs :: TcS InstEnvs
- getFamInstEnvs :: TcS (FamInstEnv, FamInstEnv)
- getTopEnv :: TcS HscEnv
- getGblEnv :: TcS TcGblEnv
- getLclEnv :: TcS TcLclEnv
- setSrcSpan :: RealSrcSpan -> TcS a -> TcS a
- getTcEvBindsVar :: TcS EvBindsVar
- getTcLevel :: TcS TcLevel
- getTcEvTyCoVars :: EvBindsVar -> TcS TyCoVarSet
- getTcEvBindsMap :: EvBindsVar -> TcS EvBindMap
- setTcEvBindsMap :: EvBindsVar -> EvBindMap -> TcS ()
- tcLookupClass :: Name -> TcS Class
- tcLookupId :: Name -> TcS Id
- tcLookupTyCon :: Name -> TcS TyCon
- updInertSet :: (InertSet -> InertSet) -> TcS ()
- updInertCans :: (InertCans -> InertCans) -> TcS ()
- getHasGivenEqs :: TcLevel -> TcS (HasGivenEqs, InertIrreds)
- setInertCans :: InertCans -> TcS ()
- getInertEqs :: TcS InertEqs
- getInertCans :: TcS InertCans
- getInertGivens :: TcS [Ct]
- getInertInsols :: TcS Cts
- getInnermostGivenEqLevel :: TcS TcLevel
- getInertSet :: TcS InertSet
- setInertSet :: InertSet -> TcS ()
- getUnsolvedInerts :: TcS (Bag Implication, Cts)
- removeInertCts :: [Ct] -> InertCans -> InertCans
- getPendingGivenScs :: TcS [Ct]
- insertFunEq :: FunEqMap a -> TyCon -> [Type] -> a -> FunEqMap a
- addInertForAll :: QCInst -> TcS ()
- emitWorkNC :: [CtEvidence] -> TcS ()
- emitWork :: Cts -> TcS ()
- lookupInertDict :: InertCans -> CtLoc -> Class -> [Type] -> Maybe DictCt
- kickOutAfterUnification :: [TcTyVar] -> TcS ()
- kickOutRewritable :: KickOutSpec -> CtFlavourRole -> TcS ()
- addInertSafehask :: InertCans -> DictCt -> InertCans
- insertSafeOverlapFailureTcS :: InstanceWhat -> DictCt -> TcS ()
- updInertSafehask :: (DictMap DictCt -> DictMap DictCt) -> TcS ()
- getSafeOverlapFailures :: TcS (Bag DictCt)
- updSolvedDicts :: InstanceWhat -> DictCt -> TcS ()
- lookupSolvedDict :: InertSet -> CtLoc -> Class -> [Type] -> Maybe CtEvidence
- foldIrreds :: (IrredCt -> b -> b) -> InertIrreds -> b -> b
- lookupFamAppInert :: (CtFlavourRole -> Bool) -> TyCon -> [Type] -> TcS (Maybe (Reduction, CtFlavourRole))
- lookupFamAppCache :: TyCon -> [Type] -> TcS (Maybe Reduction)
- extendFamAppCache :: TyCon -> [Type] -> Reduction -> TcS ()
- pprKicked :: Int -> SDoc
- instDFunType :: DFunId -> [DFunInstType] -> TcS ([TcType], TcThetaType)
- wrapUnifierTcS :: CtEvidence -> Role -> (UnifyEnv -> TcM a) -> TcS (a, Bag Ct, [TcTyVar])
- unifyFunDeps :: CtEvidence -> Role -> (UnifyEnv -> TcM ()) -> TcS Bool
- uPairsTcM :: UnifyEnv -> [TypeEqn] -> TcM ()
- unifyForAllBody :: CtEvidence -> Role -> (UnifyEnv -> TcM a) -> TcS (a, Cts)
- newFlexiTcSTy :: Kind -> TcS TcType
- instFlexiX :: Subst -> [TKVar] -> TcS Subst
- cloneMetaTyVar :: TcTyVar -> TcS TcTyVar
- tcInstSkolTyVarsX :: SkolemInfo -> Subst -> [TyVar] -> TcS (Subst, [TcTyVar])
- data TcLevel
- isFilledMetaTyVar_maybe :: TcTyVar -> TcS (Maybe Type)
- isFilledMetaTyVar :: TcTyVar -> TcS Bool
- isUnfilledMetaTyVar :: TcTyVar -> TcS Bool
- zonkTyCoVarsAndFV :: TcTyCoVarSet -> TcS TcTyCoVarSet
- zonkTcType :: TcType -> TcS TcType
- zonkTcTypes :: [TcType] -> TcS [TcType]
- zonkTcTyVar :: TcTyVar -> TcS TcType
- zonkCo :: Coercion -> TcS Coercion
- zonkTyCoVarsAndFVList :: [TcTyCoVar] -> TcS [TcTyCoVar]
- zonkSimples :: Cts -> TcS Cts
- zonkWC :: WantedConstraints -> TcS WantedConstraints
- zonkTyCoVarKind :: TcTyCoVar -> TcS TcTyCoVar
- newTcRef :: a -> TcS (TcRef a)
- readTcRef :: TcRef a -> TcS a
- writeTcRef :: TcRef a -> a -> TcS ()
- updTcRef :: TcRef a -> (a -> a) -> TcS ()
- getDefaultInfo :: TcS ([Type], (Bool, Bool))
- getDynFlags :: HasDynFlags m => m DynFlags
- getGlobalRdrEnvTcS :: TcS GlobalRdrEnv
- matchFam :: TyCon -> [Type] -> TcS (Maybe ReductionN)
- matchFamTcM :: TyCon -> [Type] -> TcM (Maybe ReductionN)
- checkWellStagedDFun :: CtLoc -> InstanceWhat -> PredType -> TcS ()
- pprEq :: TcType -> TcType -> SDoc
- checkTypeEq :: CtEvidence -> EqRel -> CanEqLHS -> TcType -> TcS (PuResult () Reduction)
- checkTouchableTyVarEq :: CtEvidence -> TcTyVar -> TcType -> TcS (PuResult () Reduction)

# Documentation

data TcS a Source #

#### Instances

Instances details

MonadIO TcS Source # |
Instance details Defined in GHC.Tc.Solver.Monad Methods liftIO :: IO a -> TcS a Source #
HasDynFlags TcS Source # |
Instance details Defined in GHC.Tc.Solver.Monad Methods getDynFlags :: TcS DynFlags Source #
MonadThings TcS Source # |
Instance details Defined in GHC.Tc.Solver.Monad Methods lookupThing :: Name -> TcS TyThing Source # lookupId :: Name -> TcS Id Source # lookupDataCon :: Name -> TcS DataCon Source # lookupTyCon :: Name -> TcS TyCon Source #
MonadUnique TcS Source # |
Instance details Defined in GHC.Tc.Solver.Monad Methods getUniqueSupplyM :: TcS UniqSupply Source # getUniqueM :: TcS Unique Source # getUniquesM :: TcS [Unique] Source #
HasModule TcS Source # |
Instance details Defined in GHC.Tc.Solver.Monad Methods getModule :: TcS Module Source #
Applicative TcS Source # |
Instance details Defined in GHC.Tc.Solver.Monad Methods pure :: a -> TcS a # (<*>) :: TcS (a -> b) -> TcS a -> TcS b # liftA2 :: (a -> b -> c) -> TcS a -> TcS b -> TcS c # (*>) :: TcS a -> TcS b -> TcS b # (<*) :: TcS a -> TcS b -> TcS a #
Functor TcS Source # |
Instance details Defined in GHC.Tc.Solver.Monad Methods fmap :: (a -> b) -> TcS a -> TcS b # (<$) :: a -> TcS b -> TcS a #
Monad TcS Source # |
Instance details Defined in GHC.Tc.Solver.Monad Methods (>>=) :: TcS a -> (a -> TcS b) -> TcS b # (>>) :: TcS a -> TcS b -> TcS b # return :: a -> TcS a #
MonadFail TcS Source # |
Instance details Defined in GHC.Tc.Solver.Monad Methods fail :: String -> TcS a #
MonadFix TcS Source # |
Instance details Defined in GHC.Tc.Solver.Monad Methods mfix :: (a -> TcS a) -> TcS a #

runTcS :: TcS a -> TcM (a, EvBindMap) Source #

runTcSEarlyAbort :: TcS a -> TcM a Source #

This variant of `runTcS` will immediately fail upon encountering an insoluble ct. See Note [Speeding up valid hole-fits]. Its one usage site does not need the ev_binds, so we do not return them.

runTcSWithEvBinds :: EvBindsVar -> TcS a -> TcM a Source #

runTcSInerts :: InertSet -> TcS a -> TcM (a, InertSet) Source #

A variant of `runTcS` that takes and returns an `InertSet` for later resumption of the `TcS` session.

failTcS :: TcRnMessage -> TcS a Source #

warnTcS :: TcRnMessage -> TcS () Source #

addErrTcS :: TcRnMessage -> TcS () Source #

wrapTcS :: TcM a -> TcS a Source #

ctLocWarnTcS :: CtLoc -> TcRnMessage -> TcS () Source #

Emit a warning within the `TcS` monad at the location given by the `CtLoc`.

runTcSEqualities :: TcS a -> TcM a Source #

This can deal only with equality constraints.

nestTcS :: TcS a -> TcS a Source #

nestImplicTcS :: EvBindsVar -> TcLevel -> TcS a -> TcS a Source #

setEvBindsTcS :: EvBindsVar -> TcS a -> TcS a Source #

emitImplicationTcS :: TcLevel -> SkolemInfoAnon -> [TcTyVar] -> [EvVar] -> Cts -> TcS TcEvBinds Source #

emitTvImplicationTcS :: TcLevel -> SkolemInfoAnon -> [TcTyVar] -> Cts -> TcS () Source #

emitFunDepWanteds :: CtEvidence -> [FunDepEqn (CtLoc, RewriterSet)] -> TcS Bool Source #

selectNextWorkItem :: TcS (Maybe Ct) Source #

getWorkList :: TcS WorkList Source #

updWorkListTcS :: (WorkList -> WorkList) -> TcS () Source #

pushLevelNoWorkList :: SDoc -> TcS a -> TcS (TcLevel, a) Source #

runTcPluginTcS :: TcPluginM a -> TcS a Source #

recordUsedGREs :: Bag GlobalRdrElt -> TcS () Source #

matchGlobalInst :: DynFlags -> Bool -> Class -> [Type] -> CtLoc -> TcS ClsInstResult Source #

data ClsInstResult Source #

Constructors

NoInstance |
OneInst |
Fields cir_new_theta :: [TcPredType] cir_mk_ev :: [EvExpr] -> EvTerm cir_canonical :: Canonical cir_what :: InstanceWhat
NotSure |

#### Instances

Instances details

Outputable ClsInstResult Source # |
Instance details Defined in GHC.Tc.Instance.Class Methods ppr :: ClsInstResult -> SDoc Source #

data QCInst Source #

Constructors

QCI |
Fields qci_ev :: CtEvidence qci_tvs :: [TcTyVar] qci_pred :: TcPredType qci_pend_sc :: ExpansionFuel

#### Instances

Instances details

Outputable QCInst Source # |
Instance details Defined in GHC.Tc.Types.Constraint Methods ppr :: QCInst -> SDoc Source #

data StopOrContinue a Source #

Constructors

StartAgain Ct |
ContinueWith !a |
Stop CtEvidence SDoc |

#### Instances

Instances details

Functor StopOrContinue Source # |
Instance details Defined in GHC.Tc.Solver.Monad Methods fmap :: (a -> b) -> StopOrContinue a -> StopOrContinue b # (<$) :: a -> StopOrContinue b -> StopOrContinue a #
Outputable a => Outputable (StopOrContinue a) Source # |
Instance details Defined in GHC.Tc.Solver.Monad Methods ppr :: StopOrContinue a -> SDoc Source #

continueWith :: a -> TcS (StopOrContinue a) Source #

stopWith :: CtEvidence -> String -> TcS (StopOrContinue a) Source #

startAgainWith :: Ct -> TcS (StopOrContinue a) Source #

newtype SolverStage a Source #

Constructors

Stage |
Fields runSolverStage :: TcS (StopOrContinue a)

#### Instances

Instances details

Applicative SolverStage Source # |
Instance details Defined in GHC.Tc.Solver.Monad Methods pure :: a -> SolverStage a # (<*>) :: SolverStage (a -> b) -> SolverStage a -> SolverStage b # liftA2 :: (a -> b -> c) -> SolverStage a -> SolverStage b -> SolverStage c # (*>) :: SolverStage a -> SolverStage b -> SolverStage b # (<*) :: SolverStage a -> SolverStage b -> SolverStage a #
Functor SolverStage Source # |
Instance details Defined in GHC.Tc.Solver.Monad Methods fmap :: (a -> b) -> SolverStage a -> SolverStage b # (<$) :: a -> SolverStage b -> SolverStage a #
Monad SolverStage Source # |
Instance details Defined in GHC.Tc.Solver.Monad Methods (>>=) :: SolverStage a -> (a -> SolverStage b) -> SolverStage b # (>>) :: SolverStage a -> SolverStage b -> SolverStage b # return :: a -> SolverStage a #

simpleStage :: TcS a -> SolverStage a Source #

stopWithStage :: CtEvidence -> String -> SolverStage a Source #

panicTcS :: SDoc -> TcS a Source #

traceTcS :: String -> SDoc -> TcS () Source #

tryEarlyAbortTcS :: TcS () Source #

traceFireTcS :: CtEvidence -> SDoc -> TcS () Source #

bumpStepCountTcS :: TcS () Source #

csTraceTcS :: SDoc -> TcS () Source #

wrapErrTcS :: TcM a -> TcS a Source #

wrapWarnTcS :: TcM a -> TcS a Source #

resetUnificationFlag :: TcS Bool Source #

setUnificationFlag :: TcLevel -> TcS () Source #

data MaybeNew Source #

Constructors

Fresh CtEvidence |
Cached EvExpr |

freshGoals :: [MaybeNew] -> [CtEvidence] Source #

isFresh :: MaybeNew -> Bool Source #

getEvExpr :: MaybeNew -> EvExpr Source #

newTcEvBinds :: TcS EvBindsVar Source #

newNoTcEvBinds :: TcS EvBindsVar Source #

newWantedEq :: CtLoc -> RewriterSet -> Role -> TcType -> TcType -> TcS (CtEvidence, Coercion) Source #

Create a new Wanted constraint holding a coercion hole for an equality between the two types at the given `Role`.

emitNewWantedEq :: CtLoc -> RewriterSet -> Role -> TcType -> TcType -> TcS Coercion Source #

Emit a new Wanted equality into the work-list

newWanted :: CtLoc -> RewriterSet -> PredType -> TcS MaybeNew Source #

Create a new Wanted constraint, potentially looking up non-equality constraints in the cache instead of creating a new one from scratch.

Deals with both equality and non-equality constraints.

newWantedNC :: CtLoc -> RewriterSet -> PredType -> TcS CtEvidence Source #

Create a new Wanted constraint.

Deals with both equality and non-equality constraints.

Does not attempt to re-use non-equality constraints that already exist in the inert set.

newWantedEvVarNC :: CtLoc -> RewriterSet -> TcPredType -> TcS CtEvidence Source #

Create a new Wanted constraint holding an evidence variable.

Don't use this for equality constraints: use `newWantedEq` instead.

newBoundEvVarId :: TcPredType -> EvTerm -> TcS EvVar Source #

Make a new `Id` of the given type, bound (in the monad's EvBinds) to the given term

unifyTyVar :: TcTyVar -> TcType -> TcS () Source #

reportUnifications :: TcS a -> TcS (Int, a) Source #

touchabilityAndShapeTest :: TcLevel -> TcTyVar -> TcType -> Bool Source #

setEvBind :: EvBind -> TcS () Source #

setWantedEq :: HasDebugCallStack => TcEvDest -> Coercion -> TcS () Source #

Equalities only

setWantedEvTerm :: TcEvDest -> Canonical -> EvTerm -> TcS () Source #

Good for both equalities and non-equalities

setEvBindIfWanted :: CtEvidence -> Canonical -> EvTerm -> TcS () Source #

newEvVar :: TcPredType -> TcS EvVar Source #

newGivenEvVar :: CtLoc -> (TcPredType, EvTerm) -> TcS CtEvidence Source #

emitNewGivens :: CtLoc -> [(Role, TcType, TcType, TcCoercion)] -> TcS () Source #

checkReductionDepth Source #

Arguments

:: CtLoc |
-> TcType | type being reduced
-> TcS () |

Checks if the depth of the given location is too much. Fails if it's too big, with an appropriate error message.

getSolvedDicts :: TcS (DictMap DictCt) Source #

setSolvedDicts :: DictMap DictCt -> TcS () Source #

getInstEnvs :: TcS InstEnvs Source #

getFamInstEnvs :: TcS (FamInstEnv, FamInstEnv) Source #

getTopEnv :: TcS HscEnv Source #

getGblEnv :: TcS TcGblEnv Source #

getLclEnv :: TcS TcLclEnv Source #

setSrcSpan :: RealSrcSpan -> TcS a -> TcS a Source #

getTcEvBindsVar :: TcS EvBindsVar Source #

getTcLevel :: TcS TcLevel Source #

getTcEvTyCoVars :: EvBindsVar -> TcS TyCoVarSet Source #

getTcEvBindsMap :: EvBindsVar -> TcS EvBindMap Source #

setTcEvBindsMap :: EvBindsVar -> EvBindMap -> TcS () Source #

tcLookupClass :: Name -> TcS Class Source #

tcLookupId :: Name -> TcS Id Source #

tcLookupTyCon :: Name -> TcS TyCon Source #

updInertSet :: (InertSet -> InertSet) -> TcS () Source #

updInertCans :: (InertCans -> InertCans) -> TcS () Source #

getHasGivenEqs :: TcLevel -> TcS (HasGivenEqs, InertIrreds) Source #

setInertCans :: InertCans -> TcS () Source #

getInertEqs :: TcS InertEqs Source #

getInertCans :: TcS InertCans Source #

getInertGivens :: TcS [Ct] Source #

getInertInsols :: TcS Cts Source #

Retrieves all insoluble constraints from the inert set, specifically including Given constraints.

This consists of:

- insoluble equalities, such as `Int ~# Bool`;
- constraints that are top-level custom type errors, of the form `TypeError msg`, but not constraints such as `Eq (TypeError msg)` in which the type error is nested;
- unsatisfiable constraints, of the form `Unsatisfiable msg`.

The inclusion of Givens is important for pattern match warnings, as we want to consider a pattern match that introduces insoluble Givens to be redundant (see Note [Pattern match warnings with insoluble Givens] in GHC.Tc.Solver).

getInnermostGivenEqLevel :: TcS TcLevel Source #

getInertSet :: TcS InertSet Source #

setInertSet :: InertSet -> TcS () Source #

getUnsolvedInerts :: TcS (Bag Implication, Cts) Source #

removeInertCts :: [Ct] -> InertCans -> InertCans Source #

Remove inert constraints from the `InertCans`, for use when a typechecker plugin wishes to discard a given.

getPendingGivenScs :: TcS [Ct] Source #

insertFunEq :: FunEqMap a -> TyCon -> [Type] -> a -> FunEqMap a Source #

addInertForAll :: QCInst -> TcS () Source #

emitWorkNC :: [CtEvidence] -> TcS () Source #

emitWork :: Cts -> TcS () Source #

lookupInertDict :: InertCans -> CtLoc -> Class -> [Type] -> Maybe DictCt Source #

Look up a dictionary inert.

kickOutAfterUnification :: [TcTyVar] -> TcS () Source #

kickOutRewritable :: KickOutSpec -> CtFlavourRole -> TcS () Source #

addInertSafehask :: InertCans -> DictCt -> InertCans Source #

insertSafeOverlapFailureTcS :: InstanceWhat -> DictCt -> TcS () Source #

updInertSafehask :: (DictMap DictCt -> DictMap DictCt) -> TcS () Source #

getSafeOverlapFailures :: TcS (Bag DictCt) Source #

updSolvedDicts :: InstanceWhat -> DictCt -> TcS () Source #

lookupSolvedDict :: InertSet -> CtLoc -> Class -> [Type] -> Maybe CtEvidence Source #

Look up a solved inert.

foldIrreds :: (IrredCt -> b -> b) -> InertIrreds -> b -> b Source #

lookupFamAppInert :: (CtFlavourRole -> Bool) -> TyCon -> [Type] -> TcS (Maybe (Reduction, CtFlavourRole)) Source #

Looks up a family application in the inerts.

lookupFamAppCache :: TyCon -> [Type] -> TcS (Maybe Reduction) Source #

extendFamAppCache :: TyCon -> [Type] -> Reduction -> TcS () Source #

pprKicked :: Int -> SDoc Source #

instDFunType :: DFunId -> [DFunInstType] -> TcS ([TcType], TcThetaType) Source #

wrapUnifierTcS :: CtEvidence -> Role -> (UnifyEnv -> TcM a) -> TcS (a, Bag Ct, [TcTyVar]) Source #

unifyFunDeps :: CtEvidence -> Role -> (UnifyEnv -> TcM ()) -> TcS Bool Source #

uPairsTcM :: UnifyEnv -> [TypeEqn] -> TcM () Source #

unifyForAllBody :: CtEvidence -> Role -> (UnifyEnv -> TcM a) -> TcS (a, Cts) Source #

newFlexiTcSTy :: Kind -> TcS TcType Source #

instFlexiX :: Subst -> [TKVar] -> TcS Subst Source #

cloneMetaTyVar :: TcTyVar -> TcS TcTyVar Source #

tcInstSkolTyVarsX :: SkolemInfo -> Subst -> [TyVar] -> TcS (Subst, [TcTyVar]) Source #

data TcLevel Source #

#### Instances

Instances details

Outputable TcLevel Source # |
Instance details Defined in GHC.Tc.Utils.TcType Methods ppr :: TcLevel -> SDoc Source #
Eq TcLevel Source # |
Instance details Defined in GHC.Tc.Utils.TcType Methods (==) :: TcLevel -> TcLevel -> Bool # (/=) :: TcLevel -> TcLevel -> Bool #
Ord TcLevel Source # |
Instance details Defined in GHC.Tc.Utils.TcType Methods compare :: TcLevel -> TcLevel -> Ordering # (<) :: TcLevel -> TcLevel -> Bool # (<=) :: TcLevel -> TcLevel -> Bool # (>) :: TcLevel -> TcLevel -> Bool # (>=) :: TcLevel -> TcLevel -> Bool # max :: TcLevel -> TcLevel -> TcLevel # min :: TcLevel -> TcLevel -> TcLevel #

isFilledMetaTyVar_maybe :: TcTyVar -> TcS (Maybe Type) Source #

isFilledMetaTyVar :: TcTyVar -> TcS Bool Source #

isUnfilledMetaTyVar :: TcTyVar -> TcS Bool Source #

zonkTyCoVarsAndFV :: TcTyCoVarSet -> TcS TcTyCoVarSet Source #

zonkTcType :: TcType -> TcS TcType Source #

zonkTcTypes :: [TcType] -> TcS [TcType] Source #

zonkTcTyVar :: TcTyVar -> TcS TcType Source #

zonkCo :: Coercion -> TcS Coercion Source #

zonkTyCoVarsAndFVList :: [TcTyCoVar] -> TcS [TcTyCoVar] Source #

zonkSimples :: Cts -> TcS Cts Source #

zonkWC :: WantedConstraints -> TcS WantedConstraints Source #

zonkTyCoVarKind :: TcTyCoVar -> TcS TcTyCoVar Source #

newTcRef :: a -> TcS (TcRef a) Source #

readTcRef :: TcRef a -> TcS a Source #

writeTcRef :: TcRef a -> a -> TcS () Source #

updTcRef :: TcRef a -> (a -> a) -> TcS () Source #

getDefaultInfo :: TcS ([Type], (Bool, Bool)) Source #

getDynFlags :: HasDynFlags m => m DynFlags Source #

getGlobalRdrEnvTcS :: TcS GlobalRdrEnv Source #

matchFam :: TyCon -> [Type] -> TcS (Maybe ReductionN) Source #

matchFamTcM :: TyCon -> [Type] -> TcM (Maybe ReductionN) Source #

checkWellStagedDFun :: CtLoc -> InstanceWhat -> PredType -> TcS () Source #

pprEq :: TcType -> TcType -> SDoc Source #

checkTypeEq :: CtEvidence -> EqRel -> CanEqLHS -> TcType -> TcS (PuResult () Reduction) Source #

checkTouchableTyVarEq :: CtEvidence -> TcTyVar -> TcType -> TcS (PuResult () Reduction) Source #