-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Concurrent actions that may fail
--
@package conceit
@version 0.1.0.0
module Control.Concurrent.Conceit
-- | Conceit is very similar to Concurrently from the
-- async package, but it has an explicit error type e.
--
-- The Applicative instance is used to run actions concurrently,
-- wait until they finish, and combine their results.
--
-- However, if any of the actions fails with e the other actions
-- are 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.
newtype Conceit e a
Conceit :: IO (Either e a) -> Conceit e a
runConceit :: Conceit e a -> IO (Either e a)
conceit :: (Show e, Typeable e) => IO (Either e a) -> IO (Either e b) -> IO (Either e (a, b))
-- | 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.
mapConceit :: (Show e, Typeable e, Traversable t) => (a -> IO (Either e b)) -> t a -> IO (Either e (t b))
instance Typeable WrappedError
instance Show e => Show (WrappedError e)
instance Functor (Conceit e)
instance (Show e, Typeable e, Monoid a) => Monoid (Conceit e a)
instance (Show e, Typeable e) => Alternative (Conceit e)
instance (Show e, Typeable e) => Applicative (Conceit e)
instance Bifunctor Conceit
instance (Show e, Typeable e) => Exception (WrappedError e)