TcSMonad

ghc-8.6.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
- extendWorkListEq :: Ct -> WorkList -> WorkList
- extendWorkListFunEq :: Ct -> WorkList -> WorkList
- appendWorkList :: WorkList -> WorkList -> WorkList
- extendWorkListImplic :: Bag Implication -> WorkList -> WorkList
- selectNextWorkItem :: TcS (Maybe Ct)
- workListSize :: WorkList -> Int
- workListWantedCount :: WorkList -> Int
- getWorkList :: TcS WorkList
- updWorkListTcS :: (WorkList -> WorkList) -> TcS ()
- data TcS a
- runTcS :: TcS a -> TcM (a, EvBindMap)
- runTcSDeriveds :: TcS a -> TcM a
- runTcSWithEvBinds :: EvBindsVar -> TcS a -> TcM a
- failTcS :: SDoc -> TcS a
- warnTcS :: WarningFlag -> SDoc -> TcS ()
- addErrTcS :: SDoc -> TcS ()
- runTcSEqualities :: TcS a -> TcM a
- nestTcS :: TcS a -> TcS a
- nestImplicTcS :: EvBindsVar -> TcLevel -> TcS a -> TcS a
- setEvBindsTcS :: EvBindsVar -> TcS a -> TcS a
- checkConstraintsTcS :: SkolemInfo -> [TcTyVar] -> [EvVar] -> TcS (result, Cts) -> TcS (result, TcEvBinds)
- checkTvConstraintsTcS :: SkolemInfo -> [TcTyVar] -> TcS (result, Cts) -> TcS result
- runTcPluginTcS :: TcPluginM a -> TcS a
- addUsedGRE :: Bool -> GlobalRdrElt -> TcS ()
- addUsedGREs :: [GlobalRdrElt] -> TcS ()
- 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
- data MaybeNew
  - = Fresh CtEvidence
  - | Cached EvExpr
- freshGoals :: [MaybeNew] -> [CtEvidence]
- isFresh :: MaybeNew -> Bool
- getEvExpr :: MaybeNew -> EvExpr
- newTcEvBinds :: TcS EvBindsVar
- newNoTcEvBinds :: TcS EvBindsVar
- newWantedEq :: CtLoc -> Role -> TcType -> TcType -> TcS (CtEvidence, Coercion)
- emitNewWantedEq :: CtLoc -> Role -> TcType -> TcType -> TcS Coercion
- newWanted :: CtLoc -> PredType -> TcS MaybeNew
- newWantedEvVar :: CtLoc -> TcPredType -> TcS MaybeNew
- newWantedNC :: CtLoc -> PredType -> TcS CtEvidence
- newWantedEvVarNC :: CtLoc -> TcPredType -> TcS CtEvidence
- newDerivedNC :: CtLoc -> TcPredType -> TcS CtEvidence
- newBoundEvVarId :: TcPredType -> EvTerm -> TcS EvVar
- unifyTyVar :: TcTyVar -> TcType -> TcS ()
- unflattenFmv :: TcTyVar -> TcType -> TcS ()
- reportUnifications :: TcS a -> TcS (Int, a)
- setEvBind :: EvBind -> TcS ()
- setWantedEq :: 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]
- emitNewDeriveds :: CtLoc -> [TcPredType] -> TcS ()
- emitNewDerivedEq :: CtLoc -> Role -> TcType -> TcType -> TcS ()
- 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
- 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
- data InertSet = IS {
  - inert_cans :: InertCans
  - inert_fsks :: [(TcTyVar, TcType)]
  - inert_flat_cache :: ExactFunEqMap (TcCoercion, TcType, CtFlavour)
  - inert_solved_dicts :: DictMap CtEvidence
  }
- data InertCans = IC {
  - inert_eqs :: InertEqs
  - inert_funeqs :: FunEqMap Ct
  - inert_dicts :: DictMap Ct
  - inert_insts :: [QCInst]
  - inert_safehask :: DictMap Ct
  - inert_irreds :: Cts
  - inert_count :: Int
  }
- updInertTcS :: (InertSet -> InertSet) -> TcS ()
- updInertCans :: (InertCans -> InertCans) -> TcS ()
- updInertDicts :: (DictMap Ct -> DictMap Ct) -> TcS ()
- updInertIrreds :: (Cts -> Cts) -> TcS ()
- getNoGivenEqs :: TcLevel -> [TcTyVar] -> TcS (Bool, Cts)
- setInertCans :: InertCans -> TcS ()
- getInertEqs :: TcS (DTyVarEnv EqualCtList)
- getInertCans :: TcS InertCans
- getInertGivens :: TcS [Ct]
- getInertInsols :: TcS Cts
- getTcSInerts :: TcS InertSet
- setTcSInerts :: InertSet -> TcS ()
- matchableGivens :: CtLoc -> PredType -> InertSet -> Cts
- prohibitedSuperClassSolve :: CtLoc -> CtLoc -> Bool
- mightMatchLater :: TcPredType -> CtLoc -> TcPredType -> CtLoc -> Bool
- getUnsolvedInerts :: TcS (Bag Implication, Cts, Cts, 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 ()
- isImprovable :: CtEvidence -> Bool
- kickOutAfterUnification :: TcTyVar -> TcS Int
- addInertSafehask :: InertCans -> Ct -> InertCans
- insertSafeOverlapFailureTcS :: Ct -> TcS ()
- updInertSafehask :: (DictMap Ct -> DictMap Ct) -> TcS ()
- getSafeOverlapFailures :: TcS Cts
- type DictMap a = TcAppMap a
- emptyDictMap :: DictMap a
- 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
- foldDicts :: (a -> b -> b) -> DictMap a -> b -> b
- filterDicts :: (Ct -> Bool) -> DictMap Ct -> DictMap Ct
- findDict :: DictMap a -> CtLoc -> Class -> [Type] -> Maybe a
- type EqualCtList = [Ct]
- findTyEqs :: InertCans -> TyVar -> EqualCtList
- foldTyEqs :: (Ct -> b -> b) -> InertEqs -> b -> b
- isInInertEqs :: DTyVarEnv EqualCtList -> TcTyVar -> TcType -> Bool
- lookupFlattenTyVar :: InertEqs -> TcTyVar -> TcType
- lookupInertTyVar :: InertEqs -> TcTyVar -> Maybe TcType
- addSolvedDict :: CtEvidence -> Class -> [Type] -> TcS ()
- lookupSolvedDict :: InertSet -> CtLoc -> Class -> [Type] -> Maybe CtEvidence
- foldIrreds :: (Ct -> b -> b) -> Cts -> b -> b
- lookupFlatCache :: TyCon -> [Type] -> TcS (Maybe (TcCoercion, TcType, CtFlavour))
- extendFlatCache :: TyCon -> [Type] -> (TcCoercion, TcType, CtFlavour) -> TcS ()
- newFlattenSkolem :: CtFlavour -> CtLoc -> TyCon -> [TcType] -> TcS (CtEvidence, Coercion, TcTyVar)
- dischargeFunEq :: CtEvidence -> TcTyVar -> TcCoercion -> TcType -> TcS ()
- pprKicked :: Int -> SDoc
- updInertFunEqs :: (FunEqMap Ct -> FunEqMap Ct) -> TcS ()
- findFunEq :: FunEqMap a -> TyCon -> [Type] -> Maybe a
- findFunEqsByTyCon :: FunEqMap a -> TyCon -> [a]
- instDFunType :: DFunId -> [DFunInstType] -> TcS ([TcType], TcThetaType)
- newFlexiTcSTy :: Kind -> TcS TcType
- instFlexi :: [TKVar] -> TcS TCvSubst
- instFlexiX :: TCvSubst -> [TKVar] -> TcS TCvSubst
- cloneMetaTyVar :: TcTyVar -> TcS TcTyVar
- demoteUnfilledFmv :: TcTyVar -> TcS ()
- tcInstType :: ([TyVar] -> TcM (TCvSubst, [TcTyVar])) -> Id -> TcS ([(Name, TcTyVar)], TcThetaType, TcType)
- tcInstSkolTyVarsX :: TCvSubst -> [TyVar] -> TcS (TCvSubst, [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
- zonkTcTyCoVarBndr :: TcTyCoVar -> TcS TcTyCoVar
- 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 (Coercion, TcType))
- matchFamTcM :: TyCon -> [Type] -> TcM (Maybe (Coercion, 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 # |
Instance details Defined in TcSMonad Methods ppr :: WorkList -> SDoc # pprPrec :: Rational -> WorkList -> SDoc #

isEmptyWorkList :: WorkList -> Bool #

emptyWorkList :: WorkList #

extendWorkListNonEq :: Ct -> WorkList -> WorkList #

extendWorkListCt :: Ct -> WorkList -> WorkList #

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

extendWorkListEq :: Ct -> WorkList -> WorkList #

extendWorkListFunEq :: Ct -> WorkList -> WorkList #

appendWorkList :: WorkList -> WorkList -> WorkList #

extendWorkListImplic :: Bag Implication -> WorkList -> WorkList #

selectNextWorkItem :: TcS (Maybe Ct) #

workListSize :: WorkList -> Int #

workListWantedCount :: WorkList -> Int #

getWorkList :: TcS WorkList #

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

data TcS a #

Instances

Monad TcS # |
Instance details Defined in TcSMonad Methods (>>=) :: TcS a -> (a -> TcS b) -> TcS b Source # (>>) :: TcS a -> TcS b -> TcS b Source # return :: a -> TcS a Source # fail :: String -> TcS a Source #
Functor TcS # |
Instance details Defined in TcSMonad Methods fmap :: (a -> b) -> TcS a -> TcS b Source # (<$) :: a -> TcS b -> TcS a Source #
MonadFail TcS # |
Instance details Defined in TcSMonad Methods fail :: String -> TcS a Source #
Applicative TcS # |
Instance details Defined in TcSMonad 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 #
MonadUnique TcS # |
Instance details Defined in TcSMonad Methods getUniqueSupplyM :: TcS UniqSupply # getUniqueM :: TcS Unique # getUniquesM :: TcS [Unique] #
HasModule TcS # |
Instance details Defined in TcSMonad Methods getModule :: TcS Module #
HasDynFlags TcS # |
Instance details Defined in TcSMonad Methods getDynFlags :: TcS DynFlags #
MonadThings TcS # |
Instance details Defined in TcSMonad Methods lookupThing :: Name -> TcS TyThing # lookupId :: Name -> TcS Id # lookupDataCon :: Name -> TcS DataCon # lookupTyCon :: Name -> TcS TyCon #

runTcS :: TcS a -> TcM (a, EvBindMap) #

runTcSDeriveds :: TcS a -> TcM a #

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.

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

failTcS :: SDoc -> TcS a #

warnTcS :: WarningFlag -> SDoc -> TcS () #

addErrTcS :: SDoc -> TcS () #

runTcSEqualities :: TcS a -> TcM a #

This can deal only with equality constraints.

nestTcS :: TcS a -> TcS a #

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

setEvBindsTcS :: EvBindsVar -> TcS a -> TcS a #

checkConstraintsTcS :: SkolemInfo -> [TcTyVar] -> [EvVar] -> TcS (result, Cts) -> TcS (result, TcEvBinds) #

checkTvConstraintsTcS :: SkolemInfo -> [TcTyVar] -> TcS (result, Cts) -> TcS result #

runTcPluginTcS :: TcPluginM a -> TcS a #

addUsedGRE :: Bool -> GlobalRdrElt -> TcS () #

addUsedGREs :: [GlobalRdrElt] -> TcS () #

data QCInst #

Constructors

QCI |
Fields qci_ev :: CtEvidence qci_tvs :: [TcTyVar] qci_pred :: TcPredType qci_pend_sc :: Bool

Instances

Outputable QCInst # |
Instance details Defined in TcRnTypes Methods ppr :: QCInst -> SDoc # pprPrec :: Rational -> QCInst -> SDoc #

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 MaybeNew #

Constructors

Fresh CtEvidence |
Cached EvExpr |

freshGoals :: [MaybeNew] -> [CtEvidence] #

isFresh :: MaybeNew -> Bool #

getEvExpr :: MaybeNew -> EvExpr #

newTcEvBinds :: TcS EvBindsVar #

newNoTcEvBinds :: TcS EvBindsVar #

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

Make a new equality CtEvidence

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

Emit a new Wanted equality into the work-list

newWanted :: CtLoc -> PredType -> TcS MaybeNew #

newWantedEvVar :: CtLoc -> TcPredType -> TcS MaybeNew #

newWantedNC :: CtLoc -> PredType -> TcS CtEvidence #

newWantedEvVarNC :: CtLoc -> TcPredType -> TcS CtEvidence #

newDerivedNC :: CtLoc -> TcPredType -> TcS CtEvidence #

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

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

unifyTyVar :: TcTyVar -> TcType -> TcS () #

unflattenFmv :: TcTyVar -> TcType -> TcS () #

reportUnifications :: TcS a -> TcS (Int, a) #

setEvBind :: EvBind -> TcS () #

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

Equalities only

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

Good for both equalities and non-equalities

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

newEvVar :: TcPredType -> TcS EvVar #

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

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

emitNewDeriveds :: CtLoc -> [TcPredType] -> TcS () #

emitNewDerivedEq :: CtLoc -> Role -> TcType -> TcType -> TcS () #

checkReductionDepth #

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) #

setSolvedDicts :: DictMap CtEvidence -> TcS () #

getInstEnvs :: TcS InstEnvs #

getFamInstEnvs :: TcS (FamInstEnv, FamInstEnv) #

getTopEnv :: TcS HscEnv #

getGblEnv :: TcS TcGblEnv #

getLclEnv :: TcS TcLclEnv #

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 #

data InertSet #

Constructors

IS |
Fields inert_cans :: InertCans inert_fsks :: [(TcTyVar, TcType)] inert_flat_cache :: ExactFunEqMap (TcCoercion, TcType, CtFlavour) inert_solved_dicts :: DictMap CtEvidence

Instances

Outputable InertSet # |
Instance details Defined in TcSMonad Methods ppr :: InertSet -> SDoc # pprPrec :: Rational -> InertSet -> SDoc #

data InertCans #

Constructors

IC |
Fields inert_eqs :: InertEqs inert_funeqs :: FunEqMap Ct inert_dicts :: DictMap Ct inert_insts :: [QCInst] inert_safehask :: DictMap Ct See Note [Safe Haskell Overlapping Instances Implementation] in TcSimplify inert_irreds :: Cts inert_count :: Int

Instances

Outputable InertCans # |
Instance details Defined in TcSMonad Methods ppr :: InertCans -> SDoc # pprPrec :: Rational -> InertCans -> SDoc #

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

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

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

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

getNoGivenEqs :: TcLevel -> [TcTyVar] -> TcS (Bool, Cts) #

setInertCans :: InertCans -> TcS () #

getInertEqs :: TcS (DTyVarEnv EqualCtList) #

getInertCans :: TcS InertCans #

getInertGivens :: TcS [Ct] #

getInertInsols :: TcS Cts #

getTcSInerts :: TcS InertSet #

setTcSInerts :: InertSet -> TcS () #

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

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 TcInteract.

prohibitedSuperClassSolve :: CtLoc -> CtLoc -> Bool #

mightMatchLater :: TcPredType -> CtLoc -> TcPredType -> CtLoc -> Bool #

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

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

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

getPendingGivenScs :: TcS [Ct] #

addInertCan :: Ct -> TcS () #

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

addInertForAll :: QCInst -> TcS () #

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

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

isImprovable :: CtEvidence -> Bool #

kickOutAfterUnification :: TcTyVar -> TcS Int #

addInertSafehask :: InertCans -> Ct -> InertCans #

insertSafeOverlapFailureTcS :: Ct -> TcS () #

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

getSafeOverlapFailures :: TcS Cts #

type DictMap a = TcAppMap a #

emptyDictMap :: DictMap a #

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

Look up a dictionary inert. NB: the returned `CtEvidence` might not match the input exactly. Note [Use loose types in inert set].

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 #

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

filterDicts :: (Ct -> Bool) -> DictMap Ct -> DictMap Ct #

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

type EqualCtList = [Ct] #

findTyEqs :: InertCans -> TyVar -> EqualCtList #

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

isInInertEqs :: DTyVarEnv EqualCtList -> TcTyVar -> TcType -> Bool #

lookupFlattenTyVar :: InertEqs -> TcTyVar -> TcType #

lookupInertTyVar :: InertEqs -> TcTyVar -> Maybe TcType #

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

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

Look up a solved inert. NB: the returned `CtEvidence` might not match the input exactly. See Note [Use loose types in inert set].

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

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

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

newFlattenSkolem :: CtFlavour -> CtLoc -> TyCon -> [TcType] -> TcS (CtEvidence, Coercion, TcTyVar) #

dischargeFunEq :: CtEvidence -> TcTyVar -> TcCoercion -> TcType -> TcS () #

pprKicked :: Int -> SDoc #

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

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

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

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

newFlexiTcSTy :: Kind -> TcS TcType #

instFlexi :: [TKVar] -> TcS TCvSubst #

instFlexiX :: TCvSubst -> [TKVar] -> TcS TCvSubst #

cloneMetaTyVar :: TcTyVar -> TcS TcTyVar #

demoteUnfilledFmv :: TcTyVar -> TcS () #

tcInstType #

Arguments

:: ([TyVar] -> TcM (TCvSubst, [TcTyVar])) | How to instantiate the type variables
-> Id | Type to instantiate
-> TcS ([(Name, TcTyVar)], TcThetaType, TcType) | Result (type vars, preds (incl equalities), rho)

tcInstSkolTyVarsX :: TCvSubst -> [TyVar] -> TcS (TCvSubst, [TcTyVar]) #

data TcLevel #

Instances

Eq TcLevel # |
Instance details Defined in TcType Methods (==) :: TcLevel -> TcLevel -> Bool # (/=) :: TcLevel -> TcLevel -> Bool #
Ord TcLevel # |
Instance details Defined in 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 #
Outputable TcLevel # |
Instance details Defined in TcType Methods ppr :: TcLevel -> SDoc # pprPrec :: Rational -> TcLevel -> SDoc #

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 #

zonkTcTyCoVarBndr :: TcTyCoVar -> TcS TcTyCoVar #

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 (Coercion, TcType)) #

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

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

pprEq :: TcType -> TcType -> SDoc #