| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
Control.Concurrent.Conceit
Contents
- newtype Conceit e a = Conceit {
- runConceit :: IO (Either e a)
- _Conceit :: IO a -> Conceit e a
- _runConceit :: Conceit Void a -> IO a
- conceit :: IO (Either e a) -> IO (Either e b) -> IO (Either e (a, b))
- mapConceit :: Traversable t => (a -> IO (Either e b)) -> t a -> IO (Either e (t b))
- conceit' :: IO a -> IO b -> (MVar (Either SomeException (Either a b)) -> IO r) -> IO r
Documentation
Conceit is very similar to Concurrently from the
async package, but it has an explicit error type e.
The Applicative instance runs two actions concurrently, waits until
they finish, and combines their results.
However, if any of the actions fails with e the other action is
immediately cancelled and the whole computation fails with e.
To put it another way: Conceit behaves like Concurrently for
successes and like race for errors.
Constructors
| Conceit | |
Fields
| |
Instances
| Bifunctor Conceit Source | |
| Functor (Conceit e) Source | |
| Applicative (Conceit e) Source | |
| Alternative (Conceit e) Source | |
| Apply (Conceit s) Source |
|
| Plus (Conceit e) Source |
|
| Alt (Conceit e) Source |
|
| Monoid a => Monoid (Conceit e a) Source | |
| Semigroup a => Semigroup (Conceit e a) Source |
_runConceit :: Conceit Void a -> IO a Source
Run a Conceit as if it were a Concurrently.
mapConceit :: Traversable t => (a -> IO (Either e b)) -> t a -> IO (Either e (t b)) Source
Works similarly to mapConcurrently from the
async package, but if any of the computations fails with e, the others are
immediately cancelled and the whole computation fails with e.