ghc-7.4.2: 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

keepWanted :: Cts -> Cts

data Ct

Constructors

CDictCan |

Fields

cc_id :: EvVar
cc_flavor :: CtFlavor
cc_class :: Class
cc_tyargs :: [Xi]
cc_depth :: SubGoalDepth

CIPCan |

Fields

cc_id :: EvVar
cc_flavor :: CtFlavor
cc_ip_nm :: IPName Name
cc_ip_ty :: TcTauType
cc_depth :: SubGoalDepth

CIrredEvCan |

Fields

cc_id :: EvVar
cc_flavor :: CtFlavor
cc_ty :: Xi
cc_depth :: SubGoalDepth

CTyEqCan |

Fields

cc_id :: EvVar
cc_flavor :: CtFlavor
cc_tyvar :: TcTyVar
cc_rhs :: Xi
cc_depth :: SubGoalDepth

CFunEqCan |

Fields

cc_id :: EvVar
cc_flavor :: CtFlavor
cc_fun :: TyCon
cc_tyargs :: [Xi]
cc_rhs :: Xi
cc_depth :: SubGoalDepth

CNonCanonical |

Fields

cc_id :: EvVar
cc_flavor :: CtFlavor
cc_depth :: SubGoalDepth

Instances

Outputable Ct |

type Xi = Type

tyVarsOfCt :: Ct -> TcTyVarSet

tyVarsOfCts :: Cts -> TcTyVarSet

tyVarsOfCDicts :: Cts -> TcTyVarSet

emitFrozenError :: CtFlavor -> EvVar -> SubGoalDepth -> TcS ()

isWanted :: CtFlavor -> Bool

isGivenOrSolved :: CtFlavor -> Bool

isDerived :: CtFlavor -> Bool

isGivenOrSolvedCt :: Ct -> Bool

isGivenCt_maybe :: Ct -> Maybe GivenKind

isWantedCt :: Ct -> Bool

isDerivedCt :: Ct -> Bool

pprFlavorArising :: CtFlavor -> SDoc

isFlexiTcsTv :: TyVar -> Bool

canRewrite :: CtFlavor -> CtFlavor -> Bool

canSolve :: CtFlavor -> CtFlavor -> Bool

combineCtLoc :: CtFlavor -> CtFlavor -> WantedLoc

mkSolvedFlavor :: CtFlavor -> SkolemInfo -> EvTerm -> CtFlavor

mkGivenFlavor :: CtFlavor -> SkolemInfo -> CtFlavor

mkWantedFlavor :: CtFlavor -> CtFlavor

getWantedLoc :: Ct -> WantedLoc

data TcS a

Instances

Monad TcS |
Functor TcS |

runTcS :: SimplContext -> Untouchables -> InertSet -> WorkList -> TcS a -> TcM (a, Bag EvBind)

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

data SimplContext

Constructors

SimplInfer SDoc |
SimplRuleLhs RuleName |
SimplInteractive |
SimplCheck SDoc |

Instances

Outputable SimplContext |

isInteractive :: SimplContext -> Bool

simplEqsOnly :: SimplContext -> Bool

performDefaulting :: SimplContext -> Bool

newEvVar :: CtFlavor -> TcPredType -> TcS EvVarCreated

forceNewEvVar :: CtFlavor -> TcPredType -> TcS EvVar

delCachedEvVar :: EvVar -> CtFlavor -> TcS ()

updateFlatCache :: EvVar -> CtFlavor -> TyCon -> [Xi] -> TcType -> FlatEqOrigin -> TcS ()

flushFlatCache :: TcS ()

newGivenEqVar :: CtFlavor -> TcType -> TcType -> TcCoercion -> TcS (CtFlavor, EvVar)

newEqVar :: CtFlavor -> TcType -> TcType -> TcS EvVarCreated

newKindConstraint :: TcTyVar -> Kind -> CtFlavor -> TcS EvVarCreated

data EvVarCreated

Constructors

EvVarCreated |

Fields

evc_is_new :: Bool
evc_the_evvar :: EvVar

isNewEvVar :: EvVarCreated -> Bool

data FlatEqOrigin

Constructors

WhileFlattening |
WhenSolved |
Any |

origin_matches :: FlatEqOrigin -> FlatEqOrigin -> Bool

setEqBind :: EqVar -> TcCoercion -> CtFlavor -> TcS CtFlavor

setEvBind :: EvVar -> EvTerm -> CtFlavor -> TcS CtFlavor

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

getTcSContext :: TcS SimplContext

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

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

getTcSEvVarCacheMap :: TcS (TypeMap (EvVar, CtFlavor))

getTcSEvVarFlatCache :: TcS (TypeMap (TcCoercion, (Type, CtFlavor, FlatEqOrigin)))

setTcSEvVarCacheMap :: TypeMap (EvVar, CtFlavor) -> TcS ()

pprEvVarCache :: TypeMap (TcCoercion, a) -> SDoc

newFlattenSkolemTy :: TcType -> TcS TcType

data InertSet

Constructors

IS |

Fields

inert_eqs :: TyVarEnv (Ct, TcCoercion)
inert_eq_tvs :: InScopeSet
inert_dicts :: CCanMap Class
inert_ips :: CCanMap (IPName Name)
inert_funeqs :: CtTypeMap
inert_irreds :: Cts
inert_frozen :: Cts

Instances

Outputable InertSet |

getInertEqs :: TcS (TyVarEnv (Ct, TcCoercion), InScopeSet)

liftInertEqsTy :: (TyVarEnv (Ct, TcCoercion), InScopeSet) -> CtFlavor -> PredType -> TcCoercion

getCtCoercion :: Ct -> TcCoercion

emptyInert :: InertSet

getTcSInerts :: TcS InertSet

updInertSet :: InertSet -> AtomicInert -> InertSet

extractUnsolved :: InertSet -> ((Cts, Cts), InertSet)

extractUnsolvedTcS :: TcS (Cts, Cts)

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

updInertSetTcS :: AtomicInert -> 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

pprCtTypeMap :: TypeMap Ct -> SDoc

mkPredKeyForTypeMap :: Ct -> PredType

partitionCtTypeMap :: (Ct -> Bool) -> TypeMap Ct -> (Cts, TypeMap Ct)

instDFunTypes :: [Either TyVar TcType] -> TcS [TcType]

instDFunConstraints :: TcThetaType -> CtFlavor -> TcS [EvVarCreated]

newFlexiTcSTy :: Kind -> TcS TcType

instFlexiTcS :: TyVar -> TcS TcTyVar

compatKind :: Kind -> Kind -> Bool

compatKindTcS :: Kind -> Kind -> TcS Bool

isSubKindTcS :: Kind -> Kind -> TcS Bool

unifyKindTcS :: Type -> Type -> Kind -> Kind -> TcS Bool

type TcsUntouchables = (Untouchables, TcTyVarSet)

isTouchableMetaTyVar :: TcTyVar -> TcS Bool

isTouchableMetaTyVar_InRange :: TcsUntouchables -> TcTyVar -> Bool

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

getDynFlags :: TcS DynFlags

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

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

data MatchInstResult mi

Constructors

MatchInstNo |
MatchInstSingle mi |
MatchInstMany |

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

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

pprEq :: TcType -> TcType -> SDoc