io-classes 1.3.0.0 → 1.3.1.0
raw patch · 3 files changed
+12/−2 lines, 3 filesdep ~basePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base
API changes (from Hackage documentation)
+ Control.Monad.Class.MonadFork: forkFinally :: MonadFork m => m a -> (Either SomeException a -> m ()) -> m (ThreadId m)
Files
- CHANGELOG.md +6/−0
- io-classes.cabal +1/−1
- src/Control/Monad/Class/MonadFork.hs +5/−1
CHANGELOG.md view
@@ -6,6 +6,12 @@ ### Non-breaking changes +## 1.3.1.0++### Non-breaking changes++* Added `forkFinally` to `MonadFork`.+ ## 1.3.0.0 - `io-sim-1.3.0.0`.
io-classes.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: io-classes-version: 1.3.0.0+version: 1.3.1.0 synopsis: Type classes for concurrency with STM, ST and timing description: IO Monad class hierarchy compatible with
src/Control/Monad/Class/MonadFork.hs view
@@ -10,7 +10,7 @@ ) where import qualified Control.Concurrent as IO-import Control.Exception (AsyncException (ThreadKilled), Exception)+import Control.Exception (AsyncException (ThreadKilled), Exception, SomeException) import Control.Monad.Reader (ReaderT (..), lift) import Data.Kind (Type) import qualified GHC.Conc.Sync as IO (labelThread)@@ -35,6 +35,7 @@ forkIO :: m () -> m (ThreadId m) forkOn :: Int -> m () -> m (ThreadId m) forkIOWithUnmask :: ((forall a. m a -> m a) -> m ()) -> m (ThreadId m)+ forkFinally :: m a -> (Either SomeException a -> m ()) -> m (ThreadId m) throwTo :: Exception e => ThreadId m -> e -> m () killThread :: ThreadId m -> m ()@@ -52,6 +53,7 @@ forkIO = IO.forkIO forkOn = IO.forkOn forkIOWithUnmask = IO.forkIOWithUnmask+ forkFinally = IO.forkFinally throwTo = IO.throwTo killThread = IO.killThread yield = IO.yield@@ -68,5 +70,7 @@ let restore' :: ReaderT e m a -> ReaderT e m a restore' (ReaderT f) = ReaderT $ restore . f in runReaderT (k restore') e+ forkFinally f k = ReaderT $ \e -> forkFinally (runReaderT f e)+ $ \err -> runReaderT (k err) e throwTo e t = lift (throwTo e t) yield = lift yield