-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Concurrent actions that may fail with a value. -- -- A version of the async package's -- Control.Concurrent.Async.Concurrently for which the actions may -- fail with a value. @package conceit @version 0.4.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 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. newtype Conceit e a Conceit :: IO (Either e a) -> Conceit e a [runConceit] :: Conceit e a -> IO (Either e a) -- | Construct a Conceit as if it were a Concurrently. _Conceit :: IO a -> Conceit e a -- | Run a Conceit as if it were a Concurrently. _runConceit :: Conceit Void a -> IO a conceit :: 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 :: (Traversable t) => (a -> IO (Either e b)) -> t a -> IO (Either e (t b)) -- | Verbatim copy of the internal concurrently' function from the -- async package. conceit' :: IO a -> IO b -> (MVar (Either SomeException (Either a b)) -> IO r) -> IO r instance GHC.Base.Functor (Control.Concurrent.Conceit.Conceit e) instance Data.Bifunctor.Bifunctor Control.Concurrent.Conceit.Conceit instance GHC.Base.Applicative (Control.Concurrent.Conceit.Conceit e) instance GHC.Base.Alternative (Control.Concurrent.Conceit.Conceit e) instance Data.Semigroup.Semigroup a => Data.Semigroup.Semigroup (Control.Concurrent.Conceit.Conceit e a) instance GHC.Base.Monoid a => GHC.Base.Monoid (Control.Concurrent.Conceit.Conceit e a) instance Data.Functor.Alt.Alt (Control.Concurrent.Conceit.Conceit e) instance Data.Functor.Plus.Plus (Control.Concurrent.Conceit.Conceit e) instance Data.Functor.Bind.Class.Apply (Control.Concurrent.Conceit.Conceit s)