pipes-safe 2.2.6 → 2.2.8
raw patch · 3 files changed
+30/−12 lines, 3 filesdep ~basedep ~exceptions
Dependency ranges changed: base, exceptions
Files
- README.md +1/−1
- pipes-safe.cabal +9/−9
- src/Pipes/Safe.hs +20/−2
README.md view
@@ -1,4 +1,4 @@-# Pipes-Safe v2.2.6+# Pipes-Safe v2.2.8 `pipes-safe` builds upon [the `pipes` library](https://github.com/Gabriel439/Haskell-Pipes-Library) to
pipes-safe.cabal view
@@ -1,5 +1,5 @@ Name: pipes-safe-Version: 2.2.6+Version: 2.2.8 Cabal-Version: >=1.8.0.2 Build-Type: Simple License: BSD3@@ -36,14 +36,14 @@ Library Build-Depends:- base >= 4 && < 5 ,- containers >= 0.3.0.0 && < 0.6,- exceptions >= 0.6 && < 0.9,- mtl >= 2.1 && < 2.3,- transformers >= 0.2.0.0 && < 0.6,- transformers-base >= 0.4.4 && < 0.5,- monad-control >= 1.0.0.4 && < 1.1,- primitive >= 0.6.2.0 && < 0.7,+ base >= 4 && < 5 ,+ containers >= 0.3.0.0 && < 0.6 ,+ exceptions >= 0.6 && < 0.11,+ mtl >= 2.1 && < 2.3 ,+ transformers >= 0.2.0.0 && < 0.6 ,+ transformers-base >= 0.4.4 && < 0.5 ,+ monad-control >= 1.0.0.4 && < 1.1 ,+ primitive >= 0.6.2.0 && < 0.7 , pipes >= 4.3.0 && < 4.4 Exposed-Modules: Pipes.Safe,
src/Pipes/Safe.hs view
@@ -94,6 +94,7 @@ ( MonadCatch(..) , MonadThrow(..) , MonadMask(..)+ , ExitCase(..) , mask_ , uninterruptibleMask_ , catchAll@@ -140,7 +141,6 @@ import Data.Monoid (Monoid) import Pipes (Proxy, Effect, Effect', runEffect) import Pipes.Internal (Proxy(..))-import Pipes.Lift (liftCatchError) data Restore m = Unmasked | Masked (forall x . m x -> m x) @@ -181,8 +181,26 @@ loop $ k unmask instance (MonadMask m, MonadIO m) => MonadMask (Proxy a' a b' b m) where- mask = liftMask mask+ mask = liftMask mask+ uninterruptibleMask = liftMask uninterruptibleMask++#if MIN_VERSION_exceptions(0,10,0)+ generalBracket acquire release_ use = mask $ \unmasked -> do+ a <- acquire+ let action = do+ b <- use a+ return (ExitCaseSuccess b, ExitCaseSuccess_ b)+ let handler e = return (ExitCaseException e, ExitCaseException_ e)+ (exitCase, exitCase_) <- unmasked action `catch` handler+ c <- release_ a exitCase+ case exitCase_ of+ ExitCaseException_ e -> throwM e+ ExitCaseSuccess_ b -> return (b, c)+#endif++-- | This is to avoid an unnecessary partial pattern match in `generalBracket`+data ExitCase_ a = ExitCaseSuccess_ a | ExitCaseException_ SomeException data Finalizers m = Finalizers { _nextKey :: !Integer