Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
GHC.Tc.Solver.InertSet
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
Constructors
WL | |
Fields
|
Instances
Outputable WorkList # | |
Defined in GHC.Tc.Solver.InertSet |
isEmptyWorkList :: WorkList -> Bool #
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 #
The inert set
Constructors
IS | |
Instances
Outputable InertSet # | |
Defined in GHC.Tc.Solver.InertSet |
Constructors
IC | |
Fields
|
Instances
Outputable InertCans # | |
Defined in GHC.Tc.Solver.InertSet |
emptyInert :: InertSet #
noMatchableGivenDicts :: InertSet -> CtLoc -> Class -> [TcType] -> Bool #
Returns True iff there are no Given constraints that might, potentially, match the given class consraint. 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
noGivenNewtypeReprEqs :: TyCon -> InertSet -> Bool #
mightEqualLater :: InertSet -> TcPredType -> CtLoc -> TcPredType -> CtLoc -> Maybe Subst #
Arguments
:: CtLoc | is it loopy to use this one ... |
-> CtLoc | ... to solve this one? |
-> Bool | True ==> don't solve it |
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 #
partitionFunEqs :: (EqCt -> Bool) -> InertFunEqs -> ([EqCt], InertFunEqs) #
foldFunEqs :: (EqCt -> b -> b) -> FunEqMap EqualCtList -> b -> b #
Inert Dicts
Inert Irreds
type InertIrreds = Bag IrredCt #
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 #
Kick-out
data KickOutSpec #
Constructors
KOAfterUnify TcTyVarSet | |
KOAfterAdding CanEqLHS |
kickOutRewritableLHS :: KickOutSpec -> CtFlavourRole -> InertCans -> (Cts, InertCans) #
Cycle breaker vars
type CycleBreakerVarStack #
Arguments
= 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 #
Push a fresh environment onto the cycle-breaker var stack. Useful when entering a nested implication.
Add a new cycle-breaker binding to the top environment on the stack.
forAllCycleBreakerBindings_ :: Monad m => CycleBreakerVarStack -> (TcTyVar -> TcType -> m ()) -> m () #
Perform a monadic operation on all pairs in the top environment in the stack.
Solving one from another
data InteractResult #
Instances
Outputable InteractResult # | |
Defined in GHC.Tc.Solver.InertSet Methods ppr :: InteractResult -> SDoc # |
solveOneFromTheOther :: Ct -> Ct -> InteractResult #