Safe Haskell | None |
---|---|
Language | GHC2021 |
Synopsis
- data WorkList = WL {
- wl_eqs :: [Ct]
- wl_rw_eqs :: [Ct]
- wl_rest :: [Ct]
- wl_implics :: Bag Implication
- isEmptyWorkList :: WorkList -> Bool
- emptyWorkList :: WorkList
- extendWorkListNonEq :: Ct -> WorkList -> WorkList
- extendWorkListCt :: Ct -> WorkList -> WorkList
- extendWorkListCts :: Cts -> WorkList -> WorkList
- extendWorkListCtList :: [Ct] -> WorkList -> WorkList
- extendWorkListEq :: RewriterSet -> Ct -> WorkList -> WorkList
- extendWorkListEqs :: RewriterSet -> Bag Ct -> WorkList -> WorkList
- appendWorkList :: WorkList -> WorkList -> WorkList
- extendWorkListImplic :: Implication -> WorkList -> WorkList
- workListSize :: WorkList -> Int
- selectWorkItem :: WorkList -> Maybe (Ct, WorkList)
- data InertSet = IS {}
- data InertCans = IC {
- inert_eqs :: InertEqs
- inert_funeqs :: InertFunEqs
- inert_dicts :: DictMap DictCt
- inert_insts :: [QCInst]
- inert_safehask :: DictMap DictCt
- inert_irreds :: InertIrreds
- inert_given_eq_lvl :: TcLevel
- inert_given_eqs :: Bool
- emptyInert :: InertSet
- noMatchableGivenDicts :: InertSet -> CtLoc -> Class -> [TcType] -> Bool
- noGivenNewtypeReprEqs :: TyCon -> InertSet -> Bool
- updGivenEqs :: TcLevel -> Ct -> InertCans -> InertCans
- mightEqualLater :: InertSet -> TcPredType -> CtLoc -> TcPredType -> CtLoc -> Maybe Subst
- prohibitedSuperClassSolve :: CtLoc -> CtLoc -> Bool
- type InertEqs = DTyVarEnv EqualCtList
- foldTyEqs :: (EqCt -> b -> b) -> InertEqs -> b -> b
- delEq :: EqCt -> InertCans -> InertCans
- findEq :: InertCans -> CanEqLHS -> [EqCt]
- partitionInertEqs :: (EqCt -> Bool) -> InertEqs -> ([EqCt], InertEqs)
- partitionFunEqs :: (EqCt -> Bool) -> InertFunEqs -> ([EqCt], InertFunEqs)
- foldFunEqs :: (EqCt -> b -> b) -> FunEqMap EqualCtList -> b -> b
- addEqToCans :: TcLevel -> EqCt -> InertCans -> InertCans
- updDicts :: (DictMap DictCt -> DictMap DictCt) -> InertCans -> InertCans
- delDict :: DictCt -> DictMap a -> DictMap a
- addDict :: DictCt -> DictMap DictCt -> DictMap DictCt
- filterDicts :: (DictCt -> Bool) -> DictMap DictCt -> DictMap DictCt
- partitionDicts :: (DictCt -> Bool) -> DictMap DictCt -> (Bag DictCt, DictMap DictCt)
- addSolvedDict :: DictCt -> DictMap DictCt -> DictMap DictCt
- type InertIrreds = Bag IrredCt
- delIrred :: IrredCt -> InertCans -> InertCans
- addIrreds :: [IrredCt] -> InertIrreds -> InertIrreds
- addIrred :: IrredCt -> InertIrreds -> InertIrreds
- foldIrreds :: (IrredCt -> b -> b) -> InertIrreds -> b -> b
- findMatchingIrreds :: InertIrreds -> CtEvidence -> (Bag (IrredCt, SwapFlag), InertIrreds)
- updIrreds :: (InertIrreds -> InertIrreds) -> InertCans -> InertCans
- addIrredToCans :: TcLevel -> IrredCt -> InertCans -> InertCans
- data KickOutSpec
- kickOutRewritableLHS :: KickOutSpec -> CtFlavourRole -> InertCans -> (Cts, InertCans)
- type CycleBreakerVarStack = NonEmpty (Bag (TcTyVar, TcType))
- pushCycleBreakerVarStack :: CycleBreakerVarStack -> CycleBreakerVarStack
- addCycleBreakerBindings :: Bag (TcTyVar, Type) -> InertSet -> InertSet
- forAllCycleBreakerBindings_ :: Monad m => CycleBreakerVarStack -> (TcTyVar -> TcType -> m ()) -> m ()
- data InteractResult
- solveOneFromTheOther :: Ct -> Ct -> InteractResult
The work list
WL | |
|
Instances
isEmptyWorkList :: WorkList -> Bool Source #
extendWorkListEq :: RewriterSet -> Ct -> WorkList -> WorkList Source #
extendWorkListEqs :: RewriterSet -> Bag Ct -> WorkList -> WorkList Source #
extendWorkListImplic :: Implication -> WorkList -> WorkList Source #
workListSize :: WorkList -> Int Source #
The inert set
Instances
IC | |
|
Instances
noMatchableGivenDicts :: InertSet -> CtLoc -> Class -> [TcType] -> Bool Source #
Returns True iff there are no Given constraints that might, potentially, match the given class constraint. 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.Dict
mightEqualLater :: InertSet -> TcPredType -> CtLoc -> TcPredType -> CtLoc -> Maybe Subst Source #
prohibitedSuperClassSolve Source #
Is it (potentially) loopy to use the first ct1
to solve ct2
?
Necessary (but not sufficient) conditions for this function to return True
:
ct1
andct2
both arise from superclass expansion,ct1
is a Given andct2
is a Wanted.
See Note [Solving superclass constraints] in GHC.Tc.TyCl.Instance, (sc2).
Inert equalities
type InertEqs = DTyVarEnv EqualCtList Source #
foldFunEqs :: (EqCt -> b -> b) -> FunEqMap EqualCtList -> b -> b Source #
Inert Dicts
Inert Irreds
type InertIrreds = Bag IrredCt Source #
addIrreds :: [IrredCt] -> InertIrreds -> InertIrreds Source #
addIrred :: IrredCt -> InertIrreds -> InertIrreds Source #
foldIrreds :: (IrredCt -> b -> b) -> InertIrreds -> b -> b Source #
findMatchingIrreds :: InertIrreds -> CtEvidence -> (Bag (IrredCt, SwapFlag), InertIrreds) Source #
updIrreds :: (InertIrreds -> InertIrreds) -> InertCans -> InertCans Source #
Kick-out
kickOutRewritableLHS :: KickOutSpec -> CtFlavourRole -> InertCans -> (Cts, InertCans) Source #
Cycle breaker vars
type CycleBreakerVarStack Source #
= NonEmpty (Bag (TcTyVar, TcType)) | a stack of (CycleBreakerTv, original family applications) lists first element in the stack corresponds to current implication; later elements correspond to outer implications used to undo the cycle-breaking needed to handle Note [Type equality cycles] in GHC.Tc.Solver.Equality Why store the outer implications? For the use in mightEqualLater (only) Why NonEmpty? So there is always a top element to add to |
pushCycleBreakerVarStack :: CycleBreakerVarStack -> CycleBreakerVarStack Source #
Push a fresh environment onto the cycle-breaker var stack. Useful when entering a nested implication.
addCycleBreakerBindings Source #
Add a new cycle-breaker binding to the top environment on the stack.
forAllCycleBreakerBindings_ :: Monad m => CycleBreakerVarStack -> (TcTyVar -> TcType -> m ()) -> m () Source #
Perform a monadic operation on all pairs in the top environment in the stack.
Solving one from another
data InteractResult Source #
Instances
Outputable InteractResult Source # | |
Defined in GHC.Tc.Solver.InertSet ppr :: InteractResult -> SDoc Source # |
solveOneFromTheOther :: Ct -> Ct -> InteractResult Source #