ghc-7.6.3: The GHC API

Safe Haskell | None

TcSMonad

# Documentation

data WorkList

Constructors

WorkList |
Fields wl_eqs :: [Ct] wl_funeqs :: [Ct] wl_rest :: [Ct]

Instances

Outputable WorkList |

isEmptyWorkList :: WorkList -> Bool

emptyWorkList :: WorkList

workListFromEq :: Ct -> WorkList

workListFromNonEq :: Ct -> WorkList

workListFromCt :: Ct -> WorkList

extendWorkListEq :: Ct -> WorkList -> WorkList

extendWorkListNonEq :: Ct -> WorkList -> WorkList

extendWorkListCt :: Ct -> WorkList -> WorkList

appendWorkListCt :: [Ct] -> WorkList -> WorkList

appendWorkListEqs :: [Ct] -> WorkList -> WorkList

unionWorkList :: WorkList -> WorkList -> WorkList

selectWorkItem :: WorkList -> (Maybe Ct, WorkList)

getTcSWorkList :: TcS WorkList

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

updWorkListTcS_return :: (WorkList -> (a, WorkList)) -> TcS a

getTcSWorkListTvs :: TcS TyVarSet

getTcSImplics :: TcS (Bag Implication)

updTcSImplics :: (Bag Implication -> Bag Implication) -> TcS ()

emitTcSImplication :: Implication -> TcS ()

data Ct

Constructors

CDictCan |
Fields cc_ev :: CtEvidence cc_class :: Class cc_tyargs :: [Xi] cc_depth :: SubGoalDepth
CIrredEvCan |
Fields cc_ev :: CtEvidence cc_ty :: Xi cc_depth :: SubGoalDepth
CTyEqCan |
Fields cc_ev :: CtEvidence cc_tyvar :: TcTyVar cc_rhs :: Xi cc_depth :: SubGoalDepth
CFunEqCan |
Fields cc_ev :: CtEvidence cc_fun :: TyCon cc_tyargs :: [Xi] cc_rhs :: Xi cc_depth :: SubGoalDepth
CNonCanonical |
Fields cc_ev :: CtEvidence cc_depth :: SubGoalDepth

Instances

Outputable Ct |

type Xi = Type

tyVarsOfCt :: Ct -> TcTyVarSet

tyVarsOfCts :: Cts -> TcTyVarSet

tyVarsOfCDicts :: Cts -> TcTyVarSet

emitFrozenError :: CtEvidence -> SubGoalDepth -> TcS ()

isWanted :: CtEvidence -> Bool

isDerived :: CtEvidence -> Bool

isGivenCt :: Ct -> Bool

isWantedCt :: Ct -> Bool

isDerivedCt :: Ct -> Bool

pprFlavorArising :: CtEvidence -> SDoc

isFlexiTcsTv :: TyVar -> Bool

instFlexiTcSHelperTcS :: Name -> Kind -> TcS TcType

canRewrite :: CtEvidence -> CtEvidence -> Bool

canSolve :: CtEvidence -> CtEvidence -> Bool

mkGivenLoc :: WantedLoc -> SkolemInfo -> GivenLoc

ctWantedLoc :: Ct -> WantedLoc

data TcS a

Instances

Monad TcS |
Functor TcS |
HasDynFlags TcS |

runTcS :: TcS a -> TcM (a, Bag EvBind)

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

failTcS :: SDoc -> TcS a

panicTcS :: SDoc -> TcS a

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

traceFireTcS :: SubGoalDepth -> SDoc -> TcS ()

bumpStepCountTcS :: TcS ()

doWithInert :: InertSet -> TcS a -> TcS a

tryTcS :: TcS a -> TcS a

nestImplicTcS :: EvBindsVar -> TcsUntouchables -> TcS a -> TcS a

recoverTcS :: TcS a -> TcS a -> TcS a

wrapErrTcS :: TcM a -> TcS a

wrapWarnTcS :: TcM a -> TcS a

getFlatCache :: TcS CtTypeMap

updFlatCache :: Ct -> TcS ()

addSolvedDict :: CtEvidence -> TcS ()

addSolvedFunEq :: CtEvidence -> TcS ()

deferTcSForAllEq :: (WantedLoc, EvVar) -> ([TyVar], TcType) -> ([TyVar], TcType) -> TcS ()

setEvBind :: EvVar -> EvTerm -> TcS ()

data XEvTerm

Constructors

XEvTerm |
Fields ev_comp :: [EvTerm] -> EvTerm ev_decomp :: EvTerm -> [EvTerm]

data MaybeNew

Constructors

Fresh CtEvidence |
Cached EvTerm |

isFresh :: MaybeNew -> Bool

freshGoals :: [MaybeNew] -> [CtEvidence]

getEvTerms :: [MaybeNew] -> [EvTerm]

xCtFlavor :: CtEvidence -> [TcPredType] -> XEvTerm -> TcS [CtEvidence]

rewriteCtFlavor :: CtEvidence -> TcPredType -> TcCoercion -> TcS (Maybe CtEvidence)

newWantedEvVar :: WantedLoc -> TcPredType -> TcS MaybeNew

instDFunConstraints :: WantedLoc -> TcThetaType -> TcS [MaybeNew]

newDerived :: WantedLoc -> TcPredType -> TcS (Maybe CtEvidence)

setWantedTyBind :: TcTyVar -> TcType -> TcS ()

getInstEnvs :: TcS (InstEnv, InstEnv)

getFamInstEnvs :: TcS (FamInstEnv, FamInstEnv)

getTopEnv :: TcS HscEnv

getGblEnv :: TcS TcGblEnv

getTcEvBinds :: TcS EvBindsVar

getUntouchables :: TcS TcsUntouchables

getTcEvBindsMap :: TcS EvBindMap

getTcSTyBinds :: TcS (IORef (TyVarEnv (TcTyVar, TcType)))

getTcSTyBindsMap :: TcS (TyVarEnv (TcTyVar, TcType))

newFlattenSkolemTy :: TcType -> TcS TcType

data InertSet

Constructors

IS |
Fields inert_cans :: InertCans inert_frozen :: Cts inert_flat_cache :: CtFamHeadMap inert_solved_funeqs :: FamHeadMap CtEvidence inert_solved_dicts :: PredMap CtEvidence

Instances

Outputable InertSet |

data InertCans

Constructors

IC |
Fields inert_eqs :: TyVarEnv Ct inert_eq_tvs :: InScopeSet inert_dicts :: CCanMap Class inert_funeqs :: CtFamHeadMap inert_irreds :: Cts

Instances

Outputable InertCans |

getInertEqs :: TcS (TyVarEnv Ct, InScopeSet)

getCtCoercion :: EvBindMap -> Ct -> TcCoercion

emptyInert :: InertSet

getTcSInerts :: TcS InertSet

lookupInInerts :: InertSet -> TcPredType -> Maybe CtEvidence

getInertUnsolved :: InertSet -> Cts

getInertInsols :: InertSet -> Cts

splitInertsForImplications :: InertSet -> ([Ct], InertSet)

modifyInertTcS :: (InertSet -> (a, InertSet)) -> TcS a

updInertSetTcS :: Ct -> TcS ()

partitionCCanMap :: (Ct -> Bool) -> CCanMap a -> (Cts, CCanMap a)

partitionEqMap :: (Ct -> Bool) -> TyVarEnv (Ct, TcCoercion) -> ([Ct], TyVarEnv (Ct, TcCoercion))

getRelevantCts :: Uniquable a => a -> CCanMap a -> (Cts, CCanMap a)

extractRelevantInerts :: Ct -> TcS Cts

data CCanMap a

Constructors

CCanMap |
Fields cts_given :: UniqFM Cts cts_derived :: UniqFM Cts cts_wanted :: UniqFM Cts

type CtTypeMap = TypeMap Ct

type CtFamHeadMap = FamHeadMap Ct

type CtPredMap = PredMap Ct

data PredMap a

Instances

Outputable a => Outputable (PredMap a) |

data FamHeadMap a

Instances

Outputable a => Outputable (FamHeadMap a) |

partCtFamHeadMap :: (Ct -> Bool) -> CtFamHeadMap -> (Cts, CtFamHeadMap)

lookupFamHead :: FamHeadMap a -> TcType -> Maybe a

filterSolved :: (CtEvidence -> Bool) -> PredMap CtEvidence -> PredMap CtEvidence

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

newFlexiTcSTy :: Kind -> TcS TcType

instFlexiTcS :: [TKVar] -> TcS (TvSubst, [TcType])

compatKind :: Kind -> Kind -> Bool

mkKindErrorCtxtTcS :: Type -> Kind -> Type -> Kind -> ErrCtxt

type TcsUntouchables = (Untouchables, TcTyVarSet)

isTouchableMetaTyVar :: TcTyVar -> TcS Bool

isTouchableMetaTyVar_InRange :: TcsUntouchables -> TcTyVar -> Bool

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

getDynFlags :: HasDynFlags m => m DynFlags

matchClass :: Class -> [Type] -> TcS (MatchInstResult (DFunId, [Maybe TcType]))

matchFam :: TyCon -> [Type] -> TcS (Maybe (FamInst, [Type]))

data MatchInstResult mi

Constructors

MatchInstNo |
MatchInstSingle mi |
MatchInstMany |

checkWellStagedDFun :: PredType -> DFunId -> WantedLoc -> TcS ()

warnTcS :: CtLoc orig -> Bool -> SDoc -> TcS ()

pprEq :: TcType -> TcType -> SDoc