pipes-safe 2.0.2 → 2.1.0
raw patch · 2 files changed
+10/−4 lines, 2 filesdep ~exceptions
Dependency ranges changed: exceptions
Files
- pipes-safe.cabal +2/−2
- src/Pipes/Safe.hs +8/−2
pipes-safe.cabal view
@@ -1,5 +1,5 @@ Name: pipes-safe-Version: 2.0.2+Version: 2.1.0 Cabal-Version: >=1.8.0.2 Build-Type: Simple License: BSD3@@ -36,7 +36,7 @@ Build-Depends: base >= 4 && < 5 , containers >= 0.3.0.0 && < 0.6,- exceptions >= 0.3.2 && < 0.4,+ exceptions >= 0.4 && < 0.6, transformers >= 0.2.0.0 && < 0.4, pipes >= 4.0.0 && < 4.2 Exposed-Modules:
src/Pipes/Safe.hs view
@@ -88,6 +88,7 @@ import qualified Control.Monad.Catch as C import Control.Monad.Catch ( MonadCatch(..)+ , MonadThrow(..) , mask_ , uninterruptibleMask_ , catchAll@@ -161,8 +162,10 @@ Pure r -> Pure r loop (k unmask) -instance (MonadCatch m, MonadIO m) => MonadCatch (Proxy a' a b' b m) where+instance MonadThrow m => MonadThrow (Proxy a' a b' b m) where throwM = lift . throwM++instance (MonadCatch m, MonadIO m) => MonadCatch (Proxy a' a b' b m) where catch = liftCatchError C.catch mask = liftMask mask uninterruptibleMask = liftMask uninterruptibleMask@@ -205,9 +208,12 @@ instance (MonadIO m) => MonadIO (SafeT m) where liftIO m = SafeT (liftIO m) +-- Deriving 'MonadThrow'+instance MonadThrow m => MonadThrow (SafeT m) where+ throwM e = SafeT (throwM e)+ -- Deriving 'MonadCatch' instance (MonadCatch m) => MonadCatch (SafeT m) where- throwM e = SafeT (throwM e) m `catch` f = SafeT (unSafeT m `C.catch` \r -> unSafeT (f r)) mask k = SafeT (mask (\restore -> unSafeT (k (\ma -> SafeT (restore (unSafeT ma)))) ))