lifted-async 0.9.0 → 0.9.1
raw patch · 4 files changed
+55/−9 lines, 4 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Control.Concurrent.Async.Lifted: instance (Control.Monad.Trans.Control.MonadBaseControl GHC.Types.IO m, GHC.Base.Monoid a) => GHC.Base.Monoid (Control.Concurrent.Async.Lifted.Concurrently m a)
- Control.Concurrent.Async.Lifted.Safe: Concurrently :: m a -> Concurrently m a
- Control.Concurrent.Async.Lifted.Safe: [runConcurrently] :: Concurrently m a -> m a
- Control.Concurrent.Async.Lifted.Safe: instance (Control.Monad.Trans.Control.MonadBaseControl GHC.Types.IO m, GHC.Base.Monoid a, Data.Constraint.Forall.Forall (Control.Concurrent.Async.Lifted.Safe.Pure m)) => GHC.Base.Monoid (Control.Concurrent.Async.Lifted.Safe.Concurrently m a)
- Control.Concurrent.Async.Lifted.Safe: instance (Control.Monad.Trans.Control.StM m a ~ a) => Control.Concurrent.Async.Lifted.Safe.Pure m a
+ Control.Concurrent.Async.Lifted: forConcurrently_ :: (Foldable t, MonadBaseControl IO m) => t a -> (a -> m b) -> m ()
+ Control.Concurrent.Async.Lifted: instance (Control.Monad.Trans.Control.MonadBaseControl GHC.Types.IO m, Data.Semigroup.Semigroup a) => Data.Semigroup.Semigroup (Control.Concurrent.Async.Lifted.Concurrently m a)
+ Control.Concurrent.Async.Lifted: instance (Control.Monad.Trans.Control.MonadBaseControl GHC.Types.IO m, Data.Semigroup.Semigroup a, GHC.Base.Monoid a) => GHC.Base.Monoid (Control.Concurrent.Async.Lifted.Concurrently m a)
+ Control.Concurrent.Async.Lifted: mapConcurrently_ :: (Foldable t, MonadBaseControl IO m) => (a -> m b) -> t a -> m ()
+ Control.Concurrent.Async.Lifted.Safe: [Concurrently] :: Forall (Pure m) => {runConcurrently :: m a} -> Concurrently m a
+ Control.Concurrent.Async.Lifted.Safe: forConcurrently :: (Traversable t, MonadBaseControl IO m, Forall (Pure m)) => t a -> (a -> m b) -> m (t b)
+ Control.Concurrent.Async.Lifted.Safe: forConcurrently_ :: (Foldable t, MonadBaseControl IO m, Forall (Pure m)) => t a -> (a -> m b) -> m ()
+ Control.Concurrent.Async.Lifted.Safe: instance (Control.Monad.Trans.Control.MonadBaseControl GHC.Types.IO m, Data.Semigroup.Semigroup a, Data.Constraint.Forall.Forall (Control.Concurrent.Async.Lifted.Safe.Pure m)) => Data.Semigroup.Semigroup (Control.Concurrent.Async.Lifted.Safe.Concurrently m a)
+ Control.Concurrent.Async.Lifted.Safe: instance (Control.Monad.Trans.Control.MonadBaseControl GHC.Types.IO m, Data.Semigroup.Semigroup a, GHC.Base.Monoid a, Data.Constraint.Forall.Forall (Control.Concurrent.Async.Lifted.Safe.Pure m)) => GHC.Base.Monoid (Control.Concurrent.Async.Lifted.Safe.Concurrently m a)
+ Control.Concurrent.Async.Lifted.Safe: instance Control.Monad.Trans.Control.StM m a ~ a => Control.Concurrent.Async.Lifted.Safe.Pure m a
+ Control.Concurrent.Async.Lifted.Safe: mapConcurrently_ :: (Foldable t, MonadBaseControl IO m, Forall (Pure m)) => (a -> m b) -> t a -> m ()
- Control.Concurrent.Async.Lifted.Safe: async :: (MonadBaseControl IO m, Forall (Pure m)) => m a -> m (Async a)
+ Control.Concurrent.Async.Lifted.Safe: async :: forall m a. (MonadBaseControl IO m, Forall (Pure m)) => m a -> m (Async a)
- Control.Concurrent.Async.Lifted.Safe: asyncBound :: (MonadBaseControl IO m, Forall (Pure m)) => m a -> m (Async a)
+ Control.Concurrent.Async.Lifted.Safe: asyncBound :: forall m a. (MonadBaseControl IO m, Forall (Pure m)) => m a -> m (Async a)
- Control.Concurrent.Async.Lifted.Safe: asyncOn :: (MonadBaseControl IO m, Forall (Pure m)) => Int -> m a -> m (Async a)
+ Control.Concurrent.Async.Lifted.Safe: asyncOn :: forall m a. (MonadBaseControl IO m, Forall (Pure m)) => Int -> m a -> m (Async a)
- Control.Concurrent.Async.Lifted.Safe: asyncOnWithUnmask :: (MonadBaseControl IO m, Forall (Pure m)) => Int -> ((forall b. m b -> m b) -> m a) -> m (Async a)
+ Control.Concurrent.Async.Lifted.Safe: asyncOnWithUnmask :: forall m a. (MonadBaseControl IO m, Forall (Pure m)) => Int -> ((forall b. m b -> m b) -> m a) -> m (Async a)
- Control.Concurrent.Async.Lifted.Safe: asyncWithUnmask :: (MonadBaseControl IO m, Forall (Pure m)) => ((forall b. m b -> m b) -> m a) -> m (Async a)
+ Control.Concurrent.Async.Lifted.Safe: asyncWithUnmask :: forall m a. (MonadBaseControl IO m, Forall (Pure m)) => ((forall b. m b -> m b) -> m a) -> m (Async a)
- Control.Concurrent.Async.Lifted.Safe: concurrently :: (MonadBaseControl IO m, Forall (Pure m)) => m a -> m b -> m (a, b)
+ Control.Concurrent.Async.Lifted.Safe: concurrently :: forall m a b. (MonadBaseControl IO m, Forall (Pure m)) => m a -> m b -> m (a, b)
- Control.Concurrent.Async.Lifted.Safe: poll :: (MonadBase IO m, Forall (Pure m)) => Async a -> m (Maybe (Either SomeException a))
+ Control.Concurrent.Async.Lifted.Safe: poll :: forall m a. (MonadBase IO m, Forall (Pure m)) => Async a -> m (Maybe (Either SomeException a))
- Control.Concurrent.Async.Lifted.Safe: race :: (MonadBaseControl IO m, Forall (Pure m)) => m a -> m b -> m (Either a b)
+ Control.Concurrent.Async.Lifted.Safe: race :: forall m a b. (MonadBaseControl IO m, Forall (Pure m)) => m a -> m b -> m (Either a b)
- Control.Concurrent.Async.Lifted.Safe: race_ :: (MonadBaseControl IO m, Forall (Pure m)) => m a -> m b -> m ()
+ Control.Concurrent.Async.Lifted.Safe: race_ :: forall m a b. (MonadBaseControl IO m, Forall (Pure m)) => m a -> m b -> m ()
- Control.Concurrent.Async.Lifted.Safe: wait :: (MonadBase IO m, Forall (Pure m)) => Async a -> m a
+ Control.Concurrent.Async.Lifted.Safe: wait :: forall m a. (MonadBase IO m, Forall (Pure m)) => Async a -> m a
- Control.Concurrent.Async.Lifted.Safe: waitAny :: (MonadBase IO m, Forall (Pure m)) => [Async a] -> m (Async a, a)
+ Control.Concurrent.Async.Lifted.Safe: waitAny :: forall m a. (MonadBase IO m, Forall (Pure m)) => [Async a] -> m (Async a, a)
- Control.Concurrent.Async.Lifted.Safe: waitAnyCancel :: (MonadBase IO m, Forall (Pure m)) => [Async a] -> m (Async a, a)
+ Control.Concurrent.Async.Lifted.Safe: waitAnyCancel :: forall m a. (MonadBase IO m, Forall (Pure m)) => [Async a] -> m (Async a, a)
- Control.Concurrent.Async.Lifted.Safe: waitAnyCatch :: (MonadBase IO m, Forall (Pure m)) => [Async a] -> m (Async a, Either SomeException a)
+ Control.Concurrent.Async.Lifted.Safe: waitAnyCatch :: forall m a. (MonadBase IO m, Forall (Pure m)) => [Async a] -> m (Async a, Either SomeException a)
- Control.Concurrent.Async.Lifted.Safe: waitAnyCatchCancel :: (MonadBase IO m, Forall (Pure m)) => [Async a] -> m (Async a, Either SomeException a)
+ Control.Concurrent.Async.Lifted.Safe: waitAnyCatchCancel :: forall m a. (MonadBase IO m, Forall (Pure m)) => [Async a] -> m (Async a, Either SomeException a)
- Control.Concurrent.Async.Lifted.Safe: waitBoth :: (MonadBase IO m, Forall (Pure m)) => Async a -> Async b -> m (a, b)
+ Control.Concurrent.Async.Lifted.Safe: waitBoth :: forall m a b. (MonadBase IO m, Forall (Pure m)) => Async a -> Async b -> m (a, b)
- Control.Concurrent.Async.Lifted.Safe: waitCatch :: (MonadBase IO m, Forall (Pure m)) => Async a -> m (Either SomeException a)
+ Control.Concurrent.Async.Lifted.Safe: waitCatch :: forall m a. (MonadBase IO m, Forall (Pure m)) => Async a -> m (Either SomeException a)
- Control.Concurrent.Async.Lifted.Safe: waitEither :: (MonadBase IO m, Forall (Pure m)) => Async a -> Async b -> m (Either a b)
+ Control.Concurrent.Async.Lifted.Safe: waitEither :: forall m a b. (MonadBase IO m, Forall (Pure m)) => Async a -> Async b -> m (Either a b)
- Control.Concurrent.Async.Lifted.Safe: waitEitherCancel :: (MonadBase IO m, Forall (Pure m)) => Async a -> Async b -> m (Either a b)
+ Control.Concurrent.Async.Lifted.Safe: waitEitherCancel :: forall m a b. (MonadBase IO m, Forall (Pure m)) => Async a -> Async b -> m (Either a b)
- Control.Concurrent.Async.Lifted.Safe: waitEitherCatch :: (MonadBase IO m, Forall (Pure m)) => Async a -> Async b -> m (Either (Either SomeException a) (Either SomeException b))
+ Control.Concurrent.Async.Lifted.Safe: waitEitherCatch :: forall m a b. (MonadBase IO m, Forall (Pure m)) => Async a -> Async b -> m (Either (Either SomeException a) (Either SomeException b))
- Control.Concurrent.Async.Lifted.Safe: waitEitherCatchCancel :: (MonadBase IO m, Forall (Pure m)) => Async a -> Async b -> m (Either (Either SomeException a) (Either SomeException b))
+ Control.Concurrent.Async.Lifted.Safe: waitEitherCatchCancel :: forall m a b. (MonadBase IO m, Forall (Pure m)) => Async a -> Async b -> m (Either (Either SomeException a) (Either SomeException b))
- Control.Concurrent.Async.Lifted.Safe: withAsync :: (MonadBaseControl IO m, Forall (Pure m)) => m a -> (Async a -> m b) -> m b
+ Control.Concurrent.Async.Lifted.Safe: withAsync :: forall m a b. (MonadBaseControl IO m, Forall (Pure m)) => m a -> (Async a -> m b) -> m b
- Control.Concurrent.Async.Lifted.Safe: withAsyncBound :: (MonadBaseControl IO m, Forall (Pure m)) => m a -> (Async a -> m b) -> m b
+ Control.Concurrent.Async.Lifted.Safe: withAsyncBound :: forall m a b. (MonadBaseControl IO m, Forall (Pure m)) => m a -> (Async a -> m b) -> m b
- Control.Concurrent.Async.Lifted.Safe: withAsyncOn :: (MonadBaseControl IO m, Forall (Pure m)) => Int -> m a -> (Async a -> m b) -> m b
+ Control.Concurrent.Async.Lifted.Safe: withAsyncOn :: forall m a b. (MonadBaseControl IO m, Forall (Pure m)) => Int -> m a -> (Async a -> m b) -> m b
- Control.Concurrent.Async.Lifted.Safe: withAsyncOnWithUnmask :: (MonadBaseControl IO m, Forall (Pure m)) => Int -> ((forall c. m c -> m c) -> m a) -> (Async a -> m b) -> m b
+ Control.Concurrent.Async.Lifted.Safe: withAsyncOnWithUnmask :: forall m a b. (MonadBaseControl IO m, Forall (Pure m)) => Int -> ((forall c. m c -> m c) -> m a) -> (Async a -> m b) -> m b
- Control.Concurrent.Async.Lifted.Safe: withAsyncWithUnmask :: (MonadBaseControl IO m, Forall (Pure m)) => ((forall c. m c -> m c) -> m a) -> (Async a -> m b) -> m b
+ Control.Concurrent.Async.Lifted.Safe: withAsyncWithUnmask :: forall m a b. (MonadBaseControl IO m, Forall (Pure m)) => ((forall c. m c -> m c) -> m a) -> (Async a -> m b) -> m b
Files
- LICENSE +1/−1
- lifted-async.cabal +3/−3
- src/Control/Concurrent/Async/Lifted.hs +22/−3
- src/Control/Concurrent/Async/Lifted/Safe.hs +29/−2
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2012, Mitsutoshi Aoe+Copyright (c) 2012-2017, Mitsutoshi Aoe All rights reserved.
lifted-async.cabal view
@@ -1,5 +1,5 @@ name: lifted-async-version: 0.9.0+version: 0.9.1 synopsis: Run lifted IO operations asynchronously and wait for their results homepage: https://github.com/maoe/lifted-async bug-reports: https://github.com/maoe/lifted-async/issues@@ -7,12 +7,12 @@ license-file: LICENSE author: Mitsutoshi Aoe maintainer: Mitsutoshi Aoe <maoe@foldr.in>-copyright: Copyright (C) 2012-2016 Mitsutoshi Aoe+copyright: Copyright (C) 2012-2017 Mitsutoshi Aoe category: Concurrency build-type: Simple cabal-version: >= 1.8 tested-with:- GHC == 8.0.1+ GHC == 8.0.2 , GHC == 7.10.2 , GHC == 7.8.4 , GHC == 7.6.3
src/Control/Concurrent/Async/Lifted.hs view
@@ -7,7 +7,7 @@ {- | Module : Control.Concurrent.Async.Lifted-Copyright : Copyright (C) 2012-2015 Mitsutoshi Aoe+Copyright : Copyright (C) 2012-2017 Mitsutoshi Aoe License : BSD-style (see the file LICENSE) Maintainer : Mitsutoshi Aoe <maoe@foldr.in> Stability : experimental@@ -63,13 +63,15 @@ , link, link2 -- * Convenient utilities- , race, race_, concurrently, mapConcurrently, forConcurrently+ , race, race_, concurrently+ , mapConcurrently, mapConcurrently_+ , forConcurrently, forConcurrently_ , Concurrently(..) ) where import Control.Applicative import Control.Concurrent (threadDelay)-import Control.Monad ((>=>), forever, liftM)+import Control.Monad ((>=>), forever, liftM, void) import GHC.IO (unsafeUnmask) import Prelude hiding (mapM) @@ -81,6 +83,7 @@ import qualified Control.Exception.Lifted as E #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ < 710+import Data.Foldable import Data.Traversable #endif #if !MIN_VERSION_base(4, 8, 0)@@ -367,6 +370,14 @@ -> m (t b) mapConcurrently f = runConcurrently . traverse (Concurrently . f) +-- | Generalized version of 'A.mapConcurrently_'.+mapConcurrently_+ :: (Foldable t, MonadBaseControl IO m)+ => (a -> m b)+ -> t a+ -> m ()+mapConcurrently_ f = runConcurrently . foldMap (Concurrently . void . f)+ -- | Generalized version of 'A.forConcurrently'. forConcurrently :: (Traversable t, MonadBaseControl IO m)@@ -374,6 +385,14 @@ -> (a -> m b) -> m (t b) forConcurrently = flip mapConcurrently++-- | Generalized version of 'A.forConcurrently_'.+forConcurrently_+ :: (Foldable t, MonadBaseControl IO m)+ => t a+ -> (a -> m b)+ -> m ()+forConcurrently_ = flip mapConcurrently_ -- | Generalized version of 'A.Concurrently'. --
src/Control/Concurrent/Async/Lifted/Safe.hs view
@@ -12,7 +12,7 @@ {- | Module : Control.Concurrent.Async.Lifted.Safe-Copyright : Copyright (C) 2012-2015 Mitsutoshi Aoe+Copyright : Copyright (C) 2012-2017 Mitsutoshi Aoe License : BSD-style (see the file LICENSE) Maintainer : Mitsutoshi Aoe <maoe@foldr.in> Stability : experimental@@ -67,7 +67,9 @@ , Unsafe.link, Unsafe.link2 -- * Convenient utilities- , race, race_, concurrently, mapConcurrently+ , race, race_, concurrently+ , mapConcurrently, mapConcurrently_+ , forConcurrently, forConcurrently_ , Concurrently(..) @@ -97,6 +99,7 @@ import qualified Control.Concurrent.Async.Lifted as Unsafe #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ < 710+import Data.Foldable import Data.Traversable #endif #if !MIN_VERSION_base(4, 8, 0)@@ -341,6 +344,30 @@ -> t a -> m (t b) mapConcurrently f = runConcurrently . traverse (Concurrently . f)++-- | Generalized version of 'A.mapConcurrently_'.+mapConcurrently_+ :: (Foldable t, MonadBaseControl IO m, Forall (Pure m))+ => (a -> m b)+ -> t a+ -> m ()+mapConcurrently_ f = runConcurrently . foldMap (Concurrently . void . f)++-- | Generalized version of 'A.forConcurrently'.+forConcurrently+ :: (Traversable t, MonadBaseControl IO m, Forall (Pure m))+ => t a+ -> (a -> m b)+ -> m (t b)+forConcurrently = flip mapConcurrently++-- | Generalized version of 'A.forConcurrently_'.+forConcurrently_+ :: (Foldable t, MonadBaseControl IO m, Forall (Pure m))+ => t a+ -> (a -> m b)+ -> m ()+forConcurrently_ = flip mapConcurrently_ -- | Generalized version of 'A.Concurrently'. --