pipes-safe 2.2.9 → 2.3.0
raw patch · 5 files changed
+41/−10 lines, 5 filesdep +faildep ~basedep ~containersPVP ok
version bump matches the API change (PVP)
Dependencies added: fail
Dependency ranges changed: base, containers
API changes (from Hackage documentation)
- Pipes.Safe: instance (Control.Monad.Catch.MonadMask m, Control.Monad.IO.Class.MonadIO m) => Control.Monad.Catch.MonadMask (Pipes.Internal.Proxy a' a b' b m)
- Pipes.Safe: instance Pipes.Safe.MonadSafe m => Pipes.Safe.MonadSafe (Pipes.Internal.Proxy a' a b' b m)
+ Pipes.Safe: ExitCaseAbort :: ExitCase a
+ Pipes.Safe: ExitCaseException :: SomeException -> ExitCase a
+ Pipes.Safe: ExitCaseSuccess :: a -> ExitCase a
+ Pipes.Safe: [Handler] :: Handler m a
+ Pipes.Safe: [SomeException] :: SomeException
+ Pipes.Safe: catch :: (MonadCatch m, Exception e) => m a -> e -> m a -> m a
+ Pipes.Safe: catchAll :: MonadCatch m => m a -> SomeException -> m a -> m a
+ Pipes.Safe: catchIOError :: MonadCatch m => m a -> IOError -> m a -> m a
+ Pipes.Safe: catchIf :: (MonadCatch m, Exception e) => e -> Bool -> m a -> e -> m a -> m a
+ Pipes.Safe: catchJust :: (MonadCatch m, Exception e) => e -> Maybe b -> m a -> b -> m a -> m a
+ Pipes.Safe: catches :: (Foldable f, MonadCatch m) => m a -> f Handler m a -> m a
+ Pipes.Safe: class (Typeable e, Show e) => Exception e
+ Pipes.Safe: class MonadThrow m => MonadCatch (m :: * -> *)
+ Pipes.Safe: class MonadCatch m => MonadMask (m :: * -> *)
+ Pipes.Safe: class Monad m => MonadThrow (m :: * -> *)
+ Pipes.Safe: data ExitCase a
+ Pipes.Safe: data Handler (m :: * -> *) a
+ Pipes.Safe: data SomeException
+ Pipes.Safe: displayException :: Exception e => e -> String
+ Pipes.Safe: fromException :: Exception e => SomeException -> Maybe e
+ Pipes.Safe: generalBracket :: MonadMask m => m a -> a -> ExitCase b -> m c -> a -> m b -> m (b, c)
+ Pipes.Safe: handle :: (MonadCatch m, Exception e) => e -> m a -> m a -> m a
+ Pipes.Safe: handleAll :: MonadCatch m => SomeException -> m a -> m a -> m a
+ Pipes.Safe: handleIOError :: MonadCatch m => IOError -> m a -> m a -> m a
+ Pipes.Safe: handleIf :: (MonadCatch m, Exception e) => e -> Bool -> e -> m a -> m a -> m a
+ Pipes.Safe: handleJust :: (MonadCatch m, Exception e) => e -> Maybe b -> b -> m a -> m a -> m a
+ Pipes.Safe: instance (Control.Monad.Catch.MonadMask m, Control.Monad.IO.Class.MonadIO m, Control.Monad.Fail.MonadFail m) => Control.Monad.Catch.MonadMask (Pipes.Internal.Proxy a' a b' b m)
+ Pipes.Safe: instance (Pipes.Safe.MonadSafe m, Control.Monad.Fail.MonadFail m) => Pipes.Safe.MonadSafe (Pipes.Internal.Proxy a' a b' b m)
+ Pipes.Safe: mask :: MonadMask m => forall a. () => m a -> m a -> m b -> m b
+ Pipes.Safe: mask_ :: MonadMask m => m a -> m a
+ Pipes.Safe: throwM :: (MonadThrow m, Exception e) => e -> m a
+ Pipes.Safe: toException :: Exception e => e -> SomeException
+ Pipes.Safe: tryJust :: (MonadCatch m, Exception e) => e -> Maybe b -> m a -> m Either b a
+ Pipes.Safe: uninterruptibleMask :: MonadMask m => forall a. () => m a -> m a -> m b -> m b
+ Pipes.Safe: uninterruptibleMask_ :: MonadMask m => m a -> m a
- Pipes.Safe.Prelude: readFile :: (MonadSafe m) => FilePath -> Producer' String m ()
+ Pipes.Safe.Prelude: readFile :: (MonadSafe m, MonadFail m) => FilePath -> Producer' String m ()
- Pipes.Safe.Prelude: writeFile :: (MonadSafe m) => FilePath -> Consumer' String m r
+ Pipes.Safe.Prelude: writeFile :: (MonadSafe m, MonadFail m) => FilePath -> Consumer' String m r
Files
- README.md +1/−1
- changelog.md +26/−0
- pipes-safe.cabal +7/−4
- src/Pipes/Safe.hs +4/−3
- src/Pipes/Safe/Prelude.hs +3/−2
README.md view
@@ -1,4 +1,4 @@-# Pipes-Safe v2.2.9+# Pipes-Safe v2.3.0 `pipes-safe` builds upon [the `pipes` library](https://github.com/Gabriel439/Haskell-Pipes-Library) to
changelog.md view
@@ -1,3 +1,29 @@+# Version 2.3.0++* BREAKING CHANGE: Support GHC 8.6.1+ * This requires adding a `MonadFail` constraints to certain utilities++# Version 2.2.9++* Fix build against older versions of `exceptions`++# Version 2.2.8++* Increase upper bound on `exceptions`++# Version 2.2.7++* Increase upper bound on `exceptions`++# Version 2.2.6++* Add `PrimMonad` instance for `SafeT`++# Version 2.2.5++* Add `tryP` and `catchP`+* `MonadThrow` and `MonadCatch` instances for `Proxy` upstreamed to `pipes`+ # Version 2.2.4 * Increase upper bound on `pipes`
pipes-safe.cabal view
@@ -1,5 +1,5 @@ Name: pipes-safe-Version: 2.2.9+Version: 2.3.0 Cabal-Version: >=1.8.0.2 Build-Type: Simple License: BSD3@@ -8,7 +8,7 @@ Copyright: 2013, 2014 Gabriel Gonzalez Author: Gabriel Gonzalez Maintainer: Gabriel439@gmail.com-Tested-With: GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.2, GHC == 8.0.1+Tested-With: GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.3 Bug-Reports: https://github.com/Gabriel439/Haskell-Pipes-Safe-Library/issues Synopsis: Safety for the pipes ecosystem Description:@@ -36,8 +36,8 @@ Library Build-Depends:- base >= 4 && < 5 ,- containers >= 0.3.0.0 && < 0.6 ,+ base >= 4.8 && < 5 ,+ containers >= 0.3.0.0 && < 0.7 , exceptions >= 0.6 && < 0.11, mtl >= 2.1 && < 2.3 , transformers >= 0.2.0.0 && < 0.6 ,@@ -45,6 +45,9 @@ monad-control >= 1.0.0.4 && < 1.1 , primitive >= 0.6.2.0 && < 0.7 , pipes >= 4.3.0 && < 4.4+ if impl(ghc < 8.0)+ Build-Depends:+ fail < 4.10 Exposed-Modules: Pipes.Safe, Pipes.Safe.Prelude
src/Pipes/Safe.hs view
@@ -115,6 +115,7 @@ , SomeException ) import Control.Monad (MonadPlus, liftM)+import Control.Monad.Fail (MonadFail) import Control.Monad.Fix (MonadFix) import Control.Monad.IO.Class (MonadIO(liftIO)) import Control.Monad.Trans.Control (MonadBaseControl(..))@@ -147,7 +148,7 @@ data Restore m = Unmasked | Masked (forall x . m x -> m x) liftMask- :: forall m a' a b' b r . (MonadIO m, MonadCatch m)+ :: forall m a' a b' b r . (MonadIO m, MonadCatch m, MonadFail m) => (forall s . ((forall x . m x -> m x) -> m s) -> m s) -> ((forall x . Proxy a' a b' b m x -> Proxy a' a b' b m x) -> Proxy a' a b' b m r)@@ -182,7 +183,7 @@ loop $ k unmask -instance (MonadMask m, MonadIO m) => MonadMask (Proxy a' a b' b m) where+instance (MonadMask m, MonadIO m, MonadFail m) => MonadMask (Proxy a' a b' b m) where mask = liftMask mask uninterruptibleMask = liftMask uninterruptibleMask@@ -331,7 +332,7 @@ Just (Finalizers n fs) -> (Just $! Finalizers n (M.delete (unlock key) fs), ()) -instance (MonadSafe m) => MonadSafe (Proxy a' a b' b m) where+instance (MonadSafe m, MonadFail m) => MonadSafe (Proxy a' a b' b m) where type Base (Proxy a' a b' b m) = Base m liftBase = lift . liftBase register = lift . register
src/Pipes/Safe/Prelude.hs view
@@ -12,6 +12,7 @@ writeFile ) where +import Control.Monad.Fail (MonadFail) import Control.Monad.IO.Class (MonadIO(liftIO)) import Pipes (Producer', Consumer') import Pipes.Safe (bracket, MonadSafe)@@ -34,13 +35,13 @@ {-| Read lines from a file, automatically opening and closing the file as necessary -}-readFile :: (MonadSafe m) => FilePath -> Producer' String m ()+readFile :: (MonadSafe m, MonadFail m) => FilePath -> Producer' String m () readFile file = withFile file IO.ReadMode P.fromHandle {-# INLINABLE readFile #-} {-| Write lines to a file, automatically opening and closing the file as necessary -}-writeFile :: (MonadSafe m) => FilePath -> Consumer' String m r+writeFile :: (MonadSafe m, MonadFail m) => FilePath -> Consumer' String m r writeFile file = withFile file IO.WriteMode P.toHandle {-# INLINABLE writeFile #-}