ghc-9.6.3: The GHC API

Safe Haskell | Safe-Inferred
Language | Haskell2010

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 ()
- 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] -> TcS ClsInstResult
- data ClsInstResult
  - = NoInstance
  - | OneInst {
    - cir_new_theta :: [TcPredType]
    - cir_mk_ev :: [EvExpr] -> EvTerm
    - cir_what :: InstanceWhat
    }
  - | NotSure
- data QCInst = QCI {
  - qci_ev :: CtEvidence
  - qci_tvs :: [TcTyVar]
  - qci_pred :: TcPredType
  - qci_pend_sc :: Bool
  }
- panicTcS :: SDoc -> TcS a
- traceTcS :: String -> SDoc -> 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)
- touchabilityTest :: CtFlavour -> TcTyVar -> TcType -> TcS (TouchabilityTestResult, TcType)
- data TouchabilityTestResult
  - = TouchableSameLevel
  - | TouchableOuterLevel [TcTyVar] TcLevel
  - | Untouchable
- setEvBind :: EvBind -> TcS ()
- setWantedEq :: HasDebugCallStack => TcEvDest -> Coercion -> TcS ()
- setWantedEvTerm :: TcEvDest -> EvTerm -> TcS ()
- setEvBindIfWanted :: CtEvidence -> EvTerm -> TcS ()
- newEvVar :: TcPredType -> TcS EvVar
- newGivenEvVar :: CtLoc -> (TcPredType, EvTerm) -> TcS CtEvidence
- newGivenEvVars :: CtLoc -> [(TcPredType, EvTerm)] -> TcS [CtEvidence]
- checkReductionDepth :: CtLoc -> TcType -> TcS ()
- getSolvedDicts :: TcS (DictMap CtEvidence)
- setSolvedDicts :: DictMap CtEvidence -> TcS ()
- getInstEnvs :: TcS InstEnvs
- getFamInstEnvs :: TcS (FamInstEnv, FamInstEnv)
- getTopEnv :: TcS HscEnv
- getGblEnv :: TcS TcGblEnv
- getLclEnv :: TcS TcLclEnv
- setLclEnv :: TcLclEnv -> 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
- updInertTcS :: (InertSet -> InertSet) -> TcS ()
- updInertCans :: (InertCans -> InertCans) -> TcS ()
- updInertDicts :: (DictMap Ct -> DictMap Ct) -> TcS ()
- updInertIrreds :: (Cts -> Cts) -> TcS ()
- getHasGivenEqs :: TcLevel -> TcS (HasGivenEqs, Cts)
- setInertCans :: InertCans -> TcS ()
- getInertEqs :: TcS InertEqs
- getInertCans :: TcS InertCans
- getInertGivens :: TcS [Ct]
- getInertInsols :: TcS Cts
- getInnermostGivenEqLevel :: TcS TcLevel
- getTcSInerts :: TcS InertSet
- setTcSInerts :: InertSet -> TcS ()
- getUnsolvedInerts :: TcS (Bag Implication, Cts)
- removeInertCts :: [Ct] -> InertCans -> InertCans
- getPendingGivenScs :: TcS [Ct]
- addInertCan :: Ct -> TcS ()
- insertFunEq :: FunEqMap a -> TyCon -> [Type] -> a -> FunEqMap a
- addInertForAll :: QCInst -> TcS ()
- emitWorkNC :: [CtEvidence] -> TcS ()
- emitWork :: [Ct] -> TcS ()
- lookupInertDict :: InertCans -> CtLoc -> Class -> [Type] -> Maybe Ct
- kickOutAfterUnification :: TcTyVar -> TcS Int
- addInertSafehask :: InertCans -> Ct -> InertCans
- insertSafeOverlapFailureTcS :: InstanceWhat -> Ct -> TcS ()
- updInertSafehask :: (DictMap Ct -> DictMap Ct) -> TcS ()
- getSafeOverlapFailures :: TcS Cts
- addSolvedDict :: InstanceWhat -> CtEvidence -> Class -> [Type] -> TcS ()
- lookupSolvedDict :: InertSet -> CtLoc -> Class -> [Type] -> Maybe CtEvidence
- foldIrreds :: (Ct -> b -> b) -> Cts -> 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)
- 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
- 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
- breakTyEqCycle_maybe :: CtEvidence -> CheckTyEqResult -> CanEqLHS -> TcType -> TcS (Maybe ReductionN)
- rewriterView :: TcType -> Maybe TcType

# Documentation

data TcS a Source #

#### Instances

Instances details

MonadFail TcS Source # |
Instance details Defined in GHC.Tc.Solver.Monad Methods fail :: String -> TcS a Source #
MonadFix TcS Source # |
Instance details Defined in GHC.Tc.Solver.Monad Methods mfix :: (a -> TcS a) -> TcS a Source #
MonadIO TcS Source # |
Instance details Defined in GHC.Tc.Solver.Monad Methods liftIO :: IO a -> TcS a Source #
Applicative TcS Source # |
Instance details Defined in GHC.Tc.Solver.Monad Methods pure :: a -> TcS a Source # (<*>) :: TcS (a -> b) -> TcS a -> TcS b Source # liftA2 :: (a -> b -> c) -> TcS a -> TcS b -> TcS c Source # (*>) :: TcS a -> TcS b -> TcS b Source # (<*) :: TcS a -> TcS b -> TcS a Source #
Functor TcS Source # |
Instance details Defined in GHC.Tc.Solver.Monad Methods fmap :: (a -> b) -> TcS a -> TcS b Source # (<$) :: a -> TcS b -> TcS a Source #
Monad TcS Source # |
Instance details Defined in GHC.Tc.Solver.Monad Methods (>>=) :: TcS a -> (a -> TcS b) -> TcS b Source # (>>) :: TcS a -> TcS b -> TcS b Source # return :: 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 #

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 #

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] -> TcS ClsInstResult Source #

data ClsInstResult Source #

Constructors

NoInstance |
OneInst |

Fields

- cir_new_theta :: [TcPredType]
- cir_mk_ev :: [EvExpr] -> EvTerm
- 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 :: Bool

#### Instances

Instances details

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

panicTcS :: SDoc -> TcS a Source #

traceTcS :: String -> SDoc -> 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 #

touchabilityTest :: CtFlavour -> TcTyVar -> TcType -> TcS (TouchabilityTestResult, TcType) Source #

This is the key test for untouchability: See Note [Unification preconditions] in GHC.Tc.Utils.Unify and Note [Solve by unification] in GHC.Tc.Solver.Interact

Returns a new rhs type, as this function can turn make some metavariables concrete.

data TouchabilityTestResult Source #

Constructors

TouchableSameLevel |
TouchableOuterLevel [TcTyVar] TcLevel |
Untouchable |

#### Instances

Instances details

Outputable TouchabilityTestResult Source # |
Instance details Defined in GHC.Tc.Solver.Monad Methods ppr :: TouchabilityTestResult -> SDoc Source #

setEvBind :: EvBind -> TcS () Source #

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

Equalities only

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

Good for both equalities and non-equalities

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

newEvVar :: TcPredType -> TcS EvVar Source #

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

newGivenEvVars :: CtLoc -> [(TcPredType, EvTerm)] -> TcS [CtEvidence] 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 CtEvidence) Source #

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

getInstEnvs :: TcS InstEnvs Source #

getFamInstEnvs :: TcS (FamInstEnv, FamInstEnv) Source #

getTopEnv :: TcS HscEnv Source #

getGblEnv :: TcS TcGblEnv Source #

getLclEnv :: TcS TcLclEnv Source #

setLclEnv :: TcLclEnv -> 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 #

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

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

updInertDicts :: (DictMap Ct -> DictMap Ct) -> TcS () Source #

updInertIrreds :: (Cts -> Cts) -> TcS () Source #

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

setInertCans :: InertCans -> TcS () Source #

getInertEqs :: TcS InertEqs Source #

getInertCans :: TcS InertCans Source #

getInertGivens :: TcS [Ct] Source #

getInertInsols :: TcS Cts Source #

getInnermostGivenEqLevel :: TcS TcLevel Source #

getTcSInerts :: TcS InertSet Source #

setTcSInerts :: 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 #

addInertCan :: Ct -> TcS () Source #

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

addInertForAll :: QCInst -> TcS () Source #

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

emitWork :: [Ct] -> TcS () Source #

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

Look up a dictionary inert.

kickOutAfterUnification :: TcTyVar -> TcS Int Source #

addInertSafehask :: InertCans -> Ct -> InertCans Source #

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

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

getSafeOverlapFailures :: TcS Cts Source #

addSolvedDict :: InstanceWhat -> CtEvidence -> Class -> [Type] -> TcS () Source #

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

Look up a solved inert.

foldIrreds :: (Ct -> b -> b) -> Cts -> 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 #

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 #

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 #

breakTyEqCycle_maybe :: CtEvidence -> CheckTyEqResult -> CanEqLHS -> TcType -> TcS (Maybe ReductionN) Source #

Conditionally replace all type family applications in the RHS with fresh variables, emitting givens that relate the type family application to the variable. See Note [Type equality cycles] in GHC.Tc.Solver.Canonical. This only works under conditions as described in the Note; otherwise, returns Nothing.

rewriterView :: TcType -> Maybe TcType Source #