Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data NonDeterministic
- choose :: MonadEffect1 NonDeterministic m => [a] -> m a
- deadEnd :: MonadEffect1 NonDeterministic m => m a
- evaluateToList :: Monad m => ListT m a -> m [a]
- traverseAllResults :: Monad m => (a -> m ()) -> ListT m a -> m ()
- foldAllResults :: Monad m => (r -> a -> m r) -> r -> ListT m a -> m r
- foldWithEarlyTermination :: Monad m => (r -> a -> m (Maybe r)) -> r -> ListT m a -> m r
- evaluateNResults :: Monad m => Int -> ListT m a -> m [a]
- evaluateOneResult :: Monad m => ListT m a -> m (Maybe a)
- module ListT
Documentation
data NonDeterministic Source #
Monad m => MonadEffect1 NonDeterministic (ListT m) Source # | |
type EffectRes1 NonDeterministic Source # | |
type EffectMsg1 NonDeterministic Source # | |
type EffectCon1 NonDeterministic a Source # | |
choose :: MonadEffect1 NonDeterministic m => [a] -> m a Source #
Runs the rest of the computation for every value in the list
deadEnd :: MonadEffect1 NonDeterministic m => m a Source #
Signals that this branch of execution failed to produce a result.
evaluateToList :: Monad m => ListT m a -> m [a] Source #
Execute all the effects and collect the result in a list. Note that this forces all the results, no matter which elements of the result list you end up actually using. For lazyer behavior use the other handlers.
traverseAllResults :: Monad m => (a -> m ()) -> ListT m a -> m () Source #
Given a function, apply it to all the results.
foldAllResults :: Monad m => (r -> a -> m r) -> r -> ListT m a -> m r Source #
Given a folding function, fold over every result. If you want to terminate eary, use the
foldWithEarlyTermination
instead.
foldWithEarlyTermination :: Monad m => (r -> a -> m (Maybe r)) -> r -> ListT m a -> m r Source #
Same as foldAllResults
but the folding function has the ability to terminate eary by
returning Nothing.
evaluateNResults :: Monad m => Int -> ListT m a -> m [a] Source #
Executes only the effects needed to produce the first n results.
evaluateOneResult :: Monad m => ListT m a -> m (Maybe a) Source #
Executes only the effects needed to produce a single result.
module ListT