TcSMonad

ghc-7.10.3: The GHC API

Safe Haskell | None
Language | Haskell2010

TcSMonad

Synopsis

- data WorkList = WL {
  - wl_eqs :: [Ct]
  - wl_funeqs :: [Ct]
  - wl_rest :: [Ct]
  - wl_implics :: Bag Implication
  }
- isEmptyWorkList :: WorkList -> Bool
- emptyWorkList :: WorkList
- extendWorkListNonEq :: Ct -> WorkList -> WorkList
- extendWorkListCt :: Ct -> WorkList -> WorkList
- extendWorkListCts :: [Ct] -> WorkList -> WorkList
- appendWorkList :: WorkList -> WorkList -> WorkList
- selectWorkItem :: WorkList -> (Maybe Ct, WorkList)
- workListSize :: WorkList -> Int
- updWorkListTcS :: (WorkList -> WorkList) -> TcS ()
- updWorkListTcS_return :: (WorkList -> (a, WorkList)) -> TcS a
- runFlatten :: TcS a -> TcS a
- emitFlatWork :: Ct -> TcS ()
- data TcS a
- runTcS :: TcS a -> TcM (a, Bag EvBind)
- runTcSWithEvBinds :: EvBindsVar -> TcS a -> TcM a
- failTcS :: SDoc -> TcS a
- tryTcS :: TcS a -> TcS a
- nestTcS :: TcS a -> TcS a
- nestImplicTcS :: EvBindsVar -> TcLevel -> TcS a -> TcS a
- recoverTcS :: TcS a -> TcS a -> TcS a
- runTcPluginTcS :: TcPluginM a -> TcS a
- addUsedRdrNamesTcS :: [RdrName] -> TcS ()
- deferTcSForAllEq :: Role -> CtLoc -> ([TyVar], TcType) -> ([TyVar], TcType) -> TcS EvTerm
- 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
- data XEvTerm = XEvTerm {
  - ev_preds :: [PredType]
  - ev_comp :: [EvTerm] -> EvTerm
  - ev_decomp :: EvTerm -> [EvTerm]
  }
- data Freshness
  - = Fresh
  - | Cached
- freshGoals :: [(CtEvidence, Freshness)] -> [CtEvidence]
- isFresh :: Freshness -> Bool
- newTcEvBinds :: TcS EvBindsVar
- newWantedEvVar :: CtLoc -> TcPredType -> TcS (CtEvidence, Freshness)
- newWantedEvVarNC :: CtLoc -> TcPredType -> TcS CtEvidence
- setWantedTyBind :: TcTyVar -> TcType -> TcS ()
- reportUnifications :: TcS a -> TcS (Bool, a)
- setEvBind :: EvVar -> EvTerm -> TcS ()
- newEvVar :: TcPredType -> TcS EvVar
- newGivenEvVar :: CtLoc -> (TcPredType, EvTerm) -> TcS CtEvidence
- newGivenEvVars :: CtLoc -> [(TcPredType, EvTerm)] -> TcS [CtEvidence]
- newDerived :: CtLoc -> TcPredType -> TcS (Maybe CtEvidence)
- emitNewDerived :: CtLoc -> TcPredType -> TcS ()
- instDFunConstraints :: CtLoc -> TcThetaType -> TcS [(CtEvidence, Freshness)]
- getInstEnvs :: TcS InstEnvs
- getFamInstEnvs :: TcS (FamInstEnv, FamInstEnv)
- getTopEnv :: TcS HscEnv
- getGblEnv :: TcS TcGblEnv
- getTcEvBinds :: TcS EvBindsVar
- getTcLevel :: TcS TcLevel
- getTcEvBindsMap :: TcS EvBindMap
- data InertSet = IS {
  - inert_cans :: InertCans
  - inert_flat_cache :: FunEqMap (TcCoercion, TcType, CtFlavour)
  - inert_solved_dicts :: DictMap CtEvidence
  }
- data InertCans = IC {
  - inert_eqs :: TyVarEnv EqualCtList
  - inert_funeqs :: FunEqMap Ct
  - inert_dicts :: DictMap Ct
  - inert_irreds :: Cts
  - inert_insols :: Cts
  }
- updInertTcS :: (InertSet -> InertSet) -> TcS ()
- updInertCans :: (InertCans -> InertCans) -> TcS ()
- updInertDicts :: (DictMap Ct -> DictMap Ct) -> TcS ()
- updInertIrreds :: (Cts -> Cts) -> TcS ()
- getNoGivenEqs :: TcLevel -> [TcTyVar] -> TcS Bool
- setInertCans :: InertCans -> TcS ()
- getInertEqs :: TcS (TyVarEnv EqualCtList)
- getInertCans :: TcS InertCans
- emptyInert :: InertSet
- getTcSInerts :: TcS InertSet
- setTcSInerts :: InertSet -> TcS ()
- getUnsolvedInerts :: TcS (Bag Implication, Cts, Cts, Cts, Cts)
- checkAllSolved :: TcS Bool
- splitInertCans :: InertCans -> ([Ct], [Ct], [Ct])
- removeInertCts :: [Ct] -> InertCans -> InertCans
- prepareInertsForImplications :: InertSet -> InertSet
- addInertCan :: InertCans -> Ct -> InertCans
- insertInertItemTcS :: Ct -> TcS ()
- insertFunEq :: FunEqMap a -> TyCon -> [Type] -> a -> FunEqMap a
- emitInsoluble :: Ct -> TcS ()
- emitWorkNC :: [CtEvidence] -> TcS ()
- type EqualCtList = [Ct]
- lookupInertDict :: InertCans -> CtLoc -> Class -> [Type] -> Maybe CtEvidence
- findDictsByClass :: DictMap a -> Class -> Bag a
- addDict :: DictMap a -> Class -> [Type] -> a -> DictMap a
- addDictsByClass :: DictMap Ct -> Class -> Bag Ct -> DictMap Ct
- delDict :: DictMap a -> Class -> [Type] -> DictMap a
- partitionDicts :: (Ct -> Bool) -> DictMap Ct -> (Bag Ct, DictMap Ct)
- findTyEqs :: InertCans -> TyVar -> EqualCtList
- addSolvedDict :: CtEvidence -> Class -> [Type] -> TcS ()
- lookupSolvedDict :: InertSet -> CtLoc -> Class -> [Type] -> Maybe CtEvidence
- lookupFlatCache :: TyCon -> [Type] -> TcS (Maybe (TcCoercion, TcType, CtFlavour))
- extendFlatCache :: TyCon -> [Type] -> (TcCoercion, TcType, CtFlavour) -> TcS ()
- newFlattenSkolem :: CtFlavour -> CtLoc -> TcType -> TcS (CtEvidence, TcTyVar)
- updInertFunEqs :: (FunEqMap Ct -> FunEqMap Ct) -> TcS ()
- findFunEq :: FunEqMap a -> TyCon -> [Type] -> Maybe a
- sizeFunEqMap :: FunEqMap a -> Int
- findFunEqsByTyCon :: FunEqMap a -> TyCon -> [a]
- findFunEqs :: FunEqMap a -> TyCon -> [Type] -> Maybe a
- partitionFunEqs :: (Ct -> Bool) -> FunEqMap Ct -> ([Ct], FunEqMap Ct)
- instDFunType :: DFunId -> [DFunInstType] -> TcS ([TcType], TcType)
- newFlexiTcSTy :: Kind -> TcS TcType
- instFlexiTcS :: [TKVar] -> TcS (TvSubst, [TcType])
- instFlexiTcSHelperTcS :: Name -> Kind -> TcS TcType
- cloneMetaTyVar :: TcTyVar -> TcS TcTyVar
- demoteUnfilledFmv :: TcTyVar -> TcS ()
- data TcLevel
- isTouchableMetaTyVarTcS :: TcTyVar -> TcS Bool
- isFilledMetaTyVar_maybe :: TcTyVar -> TcS (Maybe Type)
- isFilledMetaTyVar :: TcTyVar -> TcS Bool
- zonkTyVarsAndFV :: TcTyVarSet -> TcS TcTyVarSet
- zonkTcType :: TcType -> TcS TcType
- zonkTcTyVar :: TcTyVar -> TcS TcType
- zonkSimples :: Cts -> TcS Cts
- newTcRef :: a -> TcS (TcRef a)
- readTcRef :: TcRef a -> TcS a
- updTcRef :: TcRef a -> (a -> a) -> TcS ()
- getDefaultInfo :: TcS ([Type], (Bool, Bool))
- getDynFlags :: HasDynFlags m => m DynFlags
- getGlobalRdrEnvTcS :: TcS GlobalRdrEnv
- matchFam :: TyCon -> [Type] -> TcS (Maybe (TcCoercion, TcType))
- matchFamTcM :: TyCon -> [Type] -> TcM (Maybe (TcCoercion, TcType))
- checkWellStagedDFun :: PredType -> DFunId -> CtLoc -> TcS ()
- pprEq :: TcType -> TcType -> SDoc

# Documentation

data WorkList

Constructors

WL |
Fields wl_eqs :: [Ct] wl_funeqs :: [Ct] wl_rest :: [Ct] wl_implics :: Bag Implication

Instances

Outputable WorkList |

isEmptyWorkList :: WorkList -> Bool

emptyWorkList :: WorkList

extendWorkListNonEq :: Ct -> WorkList -> WorkList

extendWorkListCt :: Ct -> WorkList -> WorkList

extendWorkListCts :: [Ct] -> WorkList -> WorkList

appendWorkList :: WorkList -> WorkList -> WorkList

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

workListSize :: WorkList -> Int

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

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

runFlatten :: TcS a -> TcS a

emitFlatWork :: Ct -> TcS ()

data TcS a

Instances

Monad TcS |
Functor TcS |
Applicative TcS |
MonadUnique TcS |
HasDynFlags TcS |

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

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

failTcS :: SDoc -> TcS a

tryTcS :: TcS a -> TcS a

nestTcS :: TcS a -> TcS a

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

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

runTcPluginTcS :: TcPluginM a -> TcS a

addUsedRdrNamesTcS :: [RdrName] -> TcS ()

deferTcSForAllEq :: Role -> CtLoc -> ([TyVar], TcType) -> ([TyVar], TcType) -> TcS EvTerm

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

data XEvTerm

Constructors

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

data Freshness

Constructors

Fresh |
Cached |

freshGoals :: [(CtEvidence, Freshness)] -> [CtEvidence]

isFresh :: Freshness -> Bool

newTcEvBinds :: TcS EvBindsVar

newWantedEvVar :: CtLoc -> TcPredType -> TcS (CtEvidence, Freshness)

newWantedEvVarNC :: CtLoc -> TcPredType -> TcS CtEvidence

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

reportUnifications :: TcS a -> TcS (Bool, a)

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

newEvVar :: TcPredType -> TcS EvVar

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

newGivenEvVars :: CtLoc -> [(TcPredType, EvTerm)] -> TcS [CtEvidence]

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

emitNewDerived :: CtLoc -> TcPredType -> TcS ()

instDFunConstraints :: CtLoc -> TcThetaType -> TcS [(CtEvidence, Freshness)]

getInstEnvs :: TcS InstEnvs

getFamInstEnvs :: TcS (FamInstEnv, FamInstEnv)

getTopEnv :: TcS HscEnv

getGblEnv :: TcS TcGblEnv

getTcEvBinds :: TcS EvBindsVar

getTcLevel :: TcS TcLevel

getTcEvBindsMap :: TcS EvBindMap

data InertSet

Constructors

IS |
Fields inert_cans :: InertCans inert_flat_cache :: FunEqMap (TcCoercion, TcType, CtFlavour) inert_solved_dicts :: DictMap CtEvidence

Instances

Outputable InertSet |

data InertCans

Constructors

IC |
Fields inert_eqs :: TyVarEnv EqualCtList inert_funeqs :: FunEqMap Ct inert_dicts :: DictMap Ct inert_irreds :: Cts inert_insols :: Cts

Instances

Outputable InertCans |

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

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

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

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

getNoGivenEqs :: TcLevel -> [TcTyVar] -> TcS Bool

setInertCans :: InertCans -> TcS ()

getInertEqs :: TcS (TyVarEnv EqualCtList)

getInertCans :: TcS InertCans

emptyInert :: InertSet

getTcSInerts :: TcS InertSet

setTcSInerts :: InertSet -> TcS ()

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

checkAllSolved :: TcS Bool

splitInertCans :: InertCans -> ([Ct], [Ct], [Ct])

Extract the (given, derived, wanted) inert constraints

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

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

prepareInertsForImplications :: InertSet -> InertSet

addInertCan :: InertCans -> Ct -> InertCans

insertInertItemTcS :: Ct -> TcS ()

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

emitInsoluble :: Ct -> TcS ()

emitWorkNC :: [CtEvidence] -> TcS ()

type EqualCtList = [Ct]

lookupInertDict :: InertCans -> CtLoc -> Class -> [Type] -> Maybe CtEvidence

findDictsByClass :: DictMap a -> Class -> Bag a

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

addDictsByClass :: DictMap Ct -> Class -> Bag Ct -> DictMap Ct

delDict :: DictMap a -> Class -> [Type] -> DictMap a

partitionDicts :: (Ct -> Bool) -> DictMap Ct -> (Bag Ct, DictMap Ct)

findTyEqs :: InertCans -> TyVar -> EqualCtList

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

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

lookupFlatCache :: TyCon -> [Type] -> TcS (Maybe (TcCoercion, TcType, CtFlavour))

extendFlatCache :: TyCon -> [Type] -> (TcCoercion, TcType, CtFlavour) -> TcS ()

newFlattenSkolem :: CtFlavour -> CtLoc -> TcType -> TcS (CtEvidence, TcTyVar)

updInertFunEqs :: (FunEqMap Ct -> FunEqMap Ct) -> TcS ()

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

sizeFunEqMap :: FunEqMap a -> Int

findFunEqsByTyCon :: FunEqMap a -> TyCon -> [a]

findFunEqs :: FunEqMap a -> TyCon -> [Type] -> Maybe a

partitionFunEqs :: (Ct -> Bool) -> FunEqMap Ct -> ([Ct], FunEqMap Ct)

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

newFlexiTcSTy :: Kind -> TcS TcType

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

instFlexiTcSHelperTcS :: Name -> Kind -> TcS TcType

cloneMetaTyVar :: TcTyVar -> TcS TcTyVar

demoteUnfilledFmv :: TcTyVar -> TcS ()

data TcLevel

Instances

Eq TcLevel |
Outputable TcLevel |

isTouchableMetaTyVarTcS :: TcTyVar -> TcS Bool

isFilledMetaTyVar_maybe :: TcTyVar -> TcS (Maybe Type)

isFilledMetaTyVar :: TcTyVar -> TcS Bool

zonkTyVarsAndFV :: TcTyVarSet -> TcS TcTyVarSet

zonkTcType :: TcType -> TcS TcType

zonkTcTyVar :: TcTyVar -> TcS TcType

zonkSimples :: Cts -> TcS Cts

newTcRef :: a -> TcS (TcRef a)

readTcRef :: TcRef a -> TcS a

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

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

getDynFlags :: HasDynFlags m => m DynFlags

getGlobalRdrEnvTcS :: TcS GlobalRdrEnv

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

matchFamTcM :: TyCon -> [Type] -> TcM (Maybe (TcCoercion, TcType))

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

pprEq :: TcType -> TcType -> SDoc