Portability | POSIX |
---|---|
Stability | experimental |
Maintainer | bastianholst@gmx.de |
Safe Haskell | Safe-Inferred |
A monad transformer implementation for processing the results of a bag of
tasks computation. Using a processor based on the BagT
transformer allows
the calculation of values to be aborted immediately after running the
processor.
This can be use by some of the bag of tasks interfaces such as Control.Concurrent.Bag.Safe and Control.Concurrent.Bag.SafeConcurrent.
Documentation
A monad transformer for processing the results of the bag sequencially.
In addition to the actions available in the base monad, which has to be
an instance of MonadIO in all functions, it provides the action
getResult
to get a result of the bag.
BagT | |
|
getResult :: MonadIO m => BagT r m (Maybe r)Source
Get a result of the bag if there is one. If it returns Nothing, all tasks
have been processed and there are no results left. getResults
blocks
until a task has been evaluated to a result or all tasks are processed.
Therefore it may block forever.
getAllResults :: MonadIO m => BagT a m [a]Source
Convenience function to get all results from the bag of tasks.