Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- solvingProblem :: MonadConstraint m => ProblemId -> m a -> m a
- solvingProblems :: MonadConstraint m => Set ProblemId -> m a -> m a
- isProblemSolved :: (MonadTCEnv m, ReadTCState m) => ProblemId -> m Bool
- getConstraintsForProblem :: ReadTCState m => ProblemId -> m Constraints
- getAwakeConstraints :: ReadTCState m => m Constraints
- dropConstraints :: MonadConstraint m => (ProblemConstraint -> Bool) -> m ()
- takeConstraints :: MonadConstraint m => (ProblemConstraint -> Bool) -> m Constraints
- putConstraintsToSleep :: MonadConstraint m => (ProblemConstraint -> Bool) -> m ()
- putAllConstraintsToSleep :: MonadConstraint m => m ()
- data ConstraintStatus
- holdConstraints :: (ConstraintStatus -> ProblemConstraint -> Bool) -> TCM a -> TCM a
- takeAwakeConstraint :: MonadConstraint m => m (Maybe ProblemConstraint)
- takeAwakeConstraint' :: MonadConstraint m => (ProblemConstraint -> Bool) -> m (Maybe ProblemConstraint)
- getAllConstraints :: ReadTCState m => m Constraints
- withConstraint :: MonadConstraint m => (Constraint -> m a) -> ProblemConstraint -> m a
- buildProblemConstraint :: (MonadTCEnv m, ReadTCState m) => Set ProblemId -> Constraint -> m ProblemConstraint
- buildProblemConstraint_ :: (MonadTCEnv m, ReadTCState m) => Constraint -> m ProblemConstraint
- buildConstraint :: Constraint -> TCM ProblemConstraint
- class (MonadTCEnv m, ReadTCState m, MonadError TCErr m, HasOptions m, MonadDebug m) => MonadConstraint m where
- addConstraint :: Constraint -> m ()
- addAwakeConstraint :: Constraint -> m ()
- catchPatternErr :: m a -> m a -> m a
- solveConstraint :: Constraint -> m ()
- solveSomeAwakeConstraints :: (ProblemConstraint -> Bool) -> Bool -> m ()
- wakeConstraints :: (ProblemConstraint -> m Bool) -> m ()
- stealConstraints :: ProblemId -> m ()
- modifyAwakeConstraints :: (Constraints -> Constraints) -> m ()
- modifySleepingConstraints :: (Constraints -> Constraints) -> m ()
- addConstraint' :: Constraint -> TCM ()
- addAwakeConstraint' :: Constraint -> TCM ()
- addConstraintTo :: Lens' Constraints TCState -> Constraint -> TCM ()
- nowSolvingConstraints :: MonadTCEnv m => m a -> m a
- isSolvingConstraints :: MonadTCEnv m => m Bool
- catchConstraint :: MonadConstraint m => Constraint -> m () -> m ()
- mapAwakeConstraints :: (Constraints -> Constraints) -> TCState -> TCState
- mapSleepingConstraints :: (Constraints -> Constraints) -> TCState -> TCState
Documentation
solvingProblem :: MonadConstraint m => ProblemId -> m a -> m a Source #
solvingProblems :: MonadConstraint m => Set ProblemId -> m a -> m a Source #
isProblemSolved :: (MonadTCEnv m, ReadTCState m) => ProblemId -> m Bool Source #
getConstraintsForProblem :: ReadTCState m => ProblemId -> m Constraints Source #
getAwakeConstraints :: ReadTCState m => m Constraints Source #
Get the awake constraints
dropConstraints :: MonadConstraint m => (ProblemConstraint -> Bool) -> m () Source #
takeConstraints :: MonadConstraint m => (ProblemConstraint -> Bool) -> m Constraints Source #
Takes out all constraints matching given filter. Danger! The taken constraints need to be solved or put back at some point.
putConstraintsToSleep :: MonadConstraint m => (ProblemConstraint -> Bool) -> m () Source #
putAllConstraintsToSleep :: MonadConstraint m => m () Source #
data ConstraintStatus Source #
Instances
Eq ConstraintStatus Source # | |
Defined in Agda.TypeChecking.Monad.Constraints (==) :: ConstraintStatus -> ConstraintStatus -> Bool # (/=) :: ConstraintStatus -> ConstraintStatus -> Bool # | |
Show ConstraintStatus Source # | |
Defined in Agda.TypeChecking.Monad.Constraints showsPrec :: Int -> ConstraintStatus -> ShowS # show :: ConstraintStatus -> String # showList :: [ConstraintStatus] -> ShowS # |
holdConstraints :: (ConstraintStatus -> ProblemConstraint -> Bool) -> TCM a -> TCM a Source #
Suspend constraints matching the predicate during the execution of the second argument. Caution: held sleeping constraints will not be woken up by events that would normally trigger a wakeup call.
takeAwakeConstraint :: MonadConstraint m => m (Maybe ProblemConstraint) Source #
takeAwakeConstraint' :: MonadConstraint m => (ProblemConstraint -> Bool) -> m (Maybe ProblemConstraint) Source #
getAllConstraints :: ReadTCState m => m Constraints Source #
withConstraint :: MonadConstraint m => (Constraint -> m a) -> ProblemConstraint -> m a Source #
buildProblemConstraint :: (MonadTCEnv m, ReadTCState m) => Set ProblemId -> Constraint -> m ProblemConstraint Source #
buildProblemConstraint_ :: (MonadTCEnv m, ReadTCState m) => Constraint -> m ProblemConstraint Source #
class (MonadTCEnv m, ReadTCState m, MonadError TCErr m, HasOptions m, MonadDebug m) => MonadConstraint m where Source #
Monad service class containing methods for adding and solving constraints
addConstraint :: Constraint -> m () Source #
Unconditionally add the constraint.
addAwakeConstraint :: Constraint -> m () Source #
Add constraint as awake constraint.
catchPatternErr :: m a -> m a -> m a Source #
`catchPatternErr handle m` runs m, handling pattern violations
with handle
(doesn't roll back the state)
solveConstraint :: Constraint -> m () Source #
solveSomeAwakeConstraints :: (ProblemConstraint -> Bool) -> Bool -> m () Source #
Solve awake constraints matching the predicate. If the second argument is
True solve constraints even if already isSolvingConstraints
.
wakeConstraints :: (ProblemConstraint -> m Bool) -> m () Source #
stealConstraints :: ProblemId -> m () Source #
modifyAwakeConstraints :: (Constraints -> Constraints) -> m () Source #
modifySleepingConstraints :: (Constraints -> Constraints) -> m () Source #
Instances
addConstraint' :: Constraint -> TCM () Source #
Add new a constraint
addAwakeConstraint' :: Constraint -> TCM () Source #
addConstraintTo :: Lens' Constraints TCState -> Constraint -> TCM () Source #
nowSolvingConstraints :: MonadTCEnv m => m a -> m a Source #
Start solving constraints
isSolvingConstraints :: MonadTCEnv m => m Bool Source #
catchConstraint :: MonadConstraint m => Constraint -> m () -> m () Source #
Add constraint if the action raises a pattern violation
Lenses
mapAwakeConstraints :: (Constraints -> Constraints) -> TCState -> TCState Source #
mapSleepingConstraints :: (Constraints -> Constraints) -> TCState -> TCState Source #