Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data WorkList = WL {
- wl_eqs :: [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
- appendWorkList :: WorkList -> WorkList -> WorkList
- extendWorkListImplic :: Implication -> WorkList -> WorkList
- workListSize :: WorkList -> Int
- selectWorkItem :: WorkList -> Maybe (Ct, WorkList)
- data InertSet = IS {}
- data InertCans = IC {}
- type InertEqs = DTyVarEnv EqualCtList
- emptyInert :: InertSet
- addInertItem :: TcLevel -> InertCans -> Ct -> InertCans
- noMatchableGivenDicts :: InertSet -> CtLoc -> Class -> [TcType] -> Bool
- noGivenNewtypeReprEqs :: TyCon -> InertSet -> Bool
- mightEqualLater :: InertSet -> TcPredType -> CtLoc -> TcPredType -> CtLoc -> Maybe Subst
- prohibitedSuperClassSolve :: CtLoc -> CtLoc -> Bool
- foldTyEqs :: (Ct -> b -> b) -> InertEqs -> b -> b
- delEq :: InertCans -> CanEqLHS -> TcType -> InertCans
- findEq :: InertCans -> CanEqLHS -> [Ct]
- partitionInertEqs :: (Ct -> Bool) -> InertEqs -> ([Ct], InertEqs)
- partitionFunEqs :: (Ct -> Bool) -> FunEqMap EqualCtList -> ([Ct], FunEqMap EqualCtList)
- kickOutRewritableLHS :: CtFlavourRole -> CanEqLHS -> InertCans -> (WorkList, InertCans)
- type CycleBreakerVarStack = NonEmpty [(TcTyVar, TcType)]
- pushCycleBreakerVarStack :: CycleBreakerVarStack -> CycleBreakerVarStack
- insertCycleBreakerBinding :: TcTyVar -> TcType -> CycleBreakerVarStack -> CycleBreakerVarStack
- forAllCycleBreakerBindings_ :: Monad m => CycleBreakerVarStack -> (TcTyVar -> TcType -> m ()) -> m ()
The work list
WL | |
|
Instances
isEmptyWorkList :: WorkList -> Bool Source #
extendWorkListImplic :: Implication -> WorkList -> WorkList Source #
workListSize :: WorkList -> Int Source #
The inert set
Instances
IC | |
|
Instances
type InertEqs = DTyVarEnv EqualCtList Source #
noMatchableGivenDicts :: InertSet -> CtLoc -> Class -> [TcType] -> Bool Source #
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.Interact
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
partitionFunEqs :: (Ct -> Bool) -> FunEqMap EqualCtList -> ([Ct], FunEqMap EqualCtList) Source #
Kick-out
kickOutRewritableLHS :: CtFlavourRole -> CanEqLHS -> InertCans -> (WorkList, InertCans) Source #
Cycle breaker vars
type CycleBreakerVarStack Source #
= NonEmpty [(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.Canonical Why store the outer implications? For the use in mightEqualLater (only) |
pushCycleBreakerVarStack :: CycleBreakerVarStack -> CycleBreakerVarStack Source #
Push a fresh environment onto the cycle-breaker var stack. Useful when entering a nested implication.
insertCycleBreakerBinding Source #
:: TcTyVar | cbv, must be a CycleBreakerTv |
-> TcType | cbv's expansion |
-> CycleBreakerVarStack | |
-> CycleBreakerVarStack |
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.