freckle-app 1.23.0.0 → 1.23.0.1
raw patch · 4 files changed
+35/−3 lines, 4 filesPVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
API changes (from Hackage documentation)
+ Freckle.App.Async: forConcurrently :: (MonadUnliftIO m, MonadMask m, Traversable t) => t a -> (a -> m b) -> m (t b)
+ Freckle.App.Async: forConcurrently_ :: (MonadUnliftIO m, MonadMask m, Traversable t) => t a -> (a -> m b) -> m ()
+ Freckle.App.Async: mapConcurrently :: (MonadUnliftIO m, MonadMask m, Traversable t) => (a -> m b) -> t a -> m (t b)
+ Freckle.App.Async: mapConcurrently_ :: (MonadUnliftIO m, MonadMask m, Traversable t) => (a -> m b) -> t a -> m ()
Files
- CHANGELOG.md +5/−1
- freckle-app.cabal +1/−1
- library/Freckle/App/Async.hs +28/−0
- package.yaml +1/−1
CHANGELOG.md view
@@ -1,4 +1,8 @@-## [_Unreleased_](https://github.com/freckle/freckle-app/compare/freckle-app-v1.23.0.0...main)+## [_Unreleased_](https://github.com/freckle/freckle-app/compare/freckle-app-v1.23.0.1...main)++## [v1.23.0.1](https://github.com/freckle/freckle-app/compare/freckle-app-v1.23.0.0...freckle-app-v1.23.0.1)++Add more thread context preserving combinators to `Freckle.App.Async` ## [v1.23.0.0](https://github.com/freckle/freckle-app/compare/freckle-app-v1.22.0.0...freckle-app-v1.23.0.0)
freckle-app.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.22 name: freckle-app-version: 1.23.0.0+version: 1.23.0.1 license: MIT license-file: LICENSE maintainer: Freckle Education
library/Freckle/App/Async.hs view
@@ -6,6 +6,10 @@ , ThreadContext (..) , getThreadContext , withThreadContext+ , forConcurrently+ , forConcurrently_+ , mapConcurrently+ , mapConcurrently_ ) where import Freckle.App.Prelude@@ -38,6 +42,30 @@ foldConcurrently xs = do context <- getThreadContext runConc $ foldMap (conc . withThreadContext context) xs++-- | 'UnliftIO.Async.forConcurrently' but passing the thread context along+forConcurrently+ :: (MonadUnliftIO m, MonadMask m, Traversable t) => t a -> (a -> m b) -> m (t b)+forConcurrently = flip mapConcurrently++-- | 'UnliftIO.Async.mapConcurrently' but passing the thread context along+mapConcurrently+ :: (MonadUnliftIO m, MonadMask m, Traversable t) => (a -> m b) -> t a -> m (t b)+mapConcurrently f xs = do+ context <- getThreadContext+ UnliftIO.mapConcurrently (withThreadContext context . f) xs++-- | 'UnliftIO.Async.forConcurrently_' but passing the thread context along+forConcurrently_+ :: (MonadUnliftIO m, MonadMask m, Traversable t) => t a -> (a -> m b) -> m ()+forConcurrently_ = flip mapConcurrently_++-- | 'UnliftIO.Async.mapConcurrently_' but passing the thread context along+mapConcurrently_+ :: (MonadUnliftIO m, MonadMask m, Traversable t) => (a -> m b) -> t a -> m ()+mapConcurrently_ f xs = do+ context <- getThreadContext+ UnliftIO.mapConcurrently_ (withThreadContext context . f) xs -- | Wrapper around creating "Control.Immortal" processes --
package.yaml view
@@ -1,5 +1,5 @@ name: freckle-app-version: 1.23.0.0+version: 1.23.0.1 maintainer: Freckle Education category: Utils