ghc-9.2.2: The GHC API
Safe HaskellSafe-Inferred
LanguageHaskell2010

GHC.Tc.Solver.Monad

Description

Type definitions for the constraint solver

Synopsis

Documentation

data WorkList Source #

Constructors

WL 

Fields

Instances

Instances details
Outputable WorkList Source # 
Instance details

Defined in GHC.Tc.Solver.Monad

Methods

ppr :: WorkList -> SDoc Source #

data TcS a Source #

Instances

Instances details
MonadFail TcS Source # 
Instance details

Defined in GHC.Tc.Solver.Monad

Methods

fail :: String -> 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

MonadThings TcS Source # 
Instance details

Defined in GHC.Tc.Solver.Monad

MonadUnique TcS Source # 
Instance details

Defined in GHC.Tc.Solver.Monad

HasModule TcS Source # 
Instance details

Defined in GHC.Tc.Solver.Monad

runTcSDeriveds :: TcS a -> TcM a Source #

This variant of runTcS will keep solving, even when only Deriveds are left around. It also doesn't return any evidence, as callers won't need it.

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.

wrapTcS :: TcM a -> TcS a Source #

runTcSEqualities :: TcS a -> TcM a Source #

This can deal only with equality constraints.

nestTcS :: TcS a -> TcS a Source #

data ClsInstResult Source #

Instances

Instances details
Outputable ClsInstResult Source # 
Instance details

Defined in GHC.Tc.Instance.Class

data QCInst Source #

Constructors

QCI 

Instances

Instances details
Outputable QCInst Source # 
Instance details

Defined in GHC.Tc.Types.Constraint

Methods

ppr :: QCInst -> SDoc Source #

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

Make a new equality CtEvidence

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

Emit a new Wanted equality into the work-list

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

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

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

Equalities only

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

Good for both equalities and non-equalities

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.

data InertSet Source #

Instances

Instances details
Outputable InertSet Source # 
Instance details

Defined in GHC.Tc.Solver.Monad

Methods

ppr :: InertSet -> SDoc Source #

data InertCans Source #

Constructors

IC 

Fields

Instances

Instances details
Outputable InertCans Source # 
Instance details

Defined in GHC.Tc.Solver.Monad

Methods

ppr :: InertCans -> SDoc Source #

matchableGivens :: CtLoc -> PredType -> InertSet -> Cts Source #

Returns Given constraints that might, potentially, match the given pred. This is used when checking to see if a Given might overlap with an instance. See Note [Instance and Given overlap] in GHC.Tc.Solver.Interact

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

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

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

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

type DictMap a = TcAppMap a Source #

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

Look up a dictionary inert.

addDict :: DictMap a -> Class -> [Type] -> a -> DictMap a Source #

foldDicts :: (a -> b -> b) -> DictMap a -> b -> b Source #

findDict :: DictMap a -> CtLoc -> Class -> [Type] -> Maybe a Source #

newtype EqualCtList Source #

Constructors

EqualCtList (NonEmpty Ct) 

Instances

Instances details
Outputable EqualCtList Source # 
Instance details

Defined in GHC.Tc.Solver.Monad

Methods

ppr :: EqualCtList -> SDoc Source #

foldTyEqs :: (Ct -> b -> b) -> InertEqs -> b -> b Source #

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

Look up a solved inert.

foldIrreds :: (Ct -> b -> b) -> Cts -> b -> b Source #

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

Looks up a family application in the inerts; returned coercion is oriented input ~ output

findFunEq :: FunEqMap a -> TyCon -> [Type] -> Maybe a Source #

findFunEqsByTyCon :: FunEqMap a -> TyCon -> [a] 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

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

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

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

breakTyVarCycle_maybe :: CtEvidence -> CheckTyEqResult -> CanEqLHS -> TcType -> TcS (Maybe (TcTyVar, CoercionN, TcType)) 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 variable cycles] in GHC.Tc.Solver.Canonical. This only works under conditions as described in the Note; otherwise, returns Nothing.