packages feed

errors 2.2.5 → 2.3.0

raw patch · 3 files changed

+21/−9 lines, 3 filesdep −unexceptionaliodep ~basedep ~textdep ~transformersPVP ok

version bump matches the API change (PVP)

Dependencies removed: unexceptionalio

Dependency ranges changed: base, text, transformers, transformers-compat

API changes (from Hackage documentation)

- Control.Error.Util: syncIO :: Unexceptional m => IO a -> ExceptT SomeException m a
+ Control.Error.Util: syncIO :: MonadIO m => IO a -> ExceptT SomeException m a

Files

CHANGELOG.md view
@@ -1,3 +1,12 @@+# 2.3.0++* BREAKING CHANGE: `syncIO` now expects a `MonadIO` constraint instead of+  `UnexceptionalIO`+    * `syncIO` also changes how it detects asynchronous exceptions.  It now+      decides based on whether or not an exception inherits from+      `SomeAsyncException`+    * See: https://github.com/Gabriel439/Haskell-Errors-Library/pull/53+ # 2.2.5  * Increase upper bound on `exceptions`
Control/Error/Util.hs view
@@ -67,11 +67,9 @@ import Data.Maybe (fromMaybe) import Data.Text (Text) import System.IO (stderr)-import UnexceptionalIO (Unexceptional)  import qualified Control.Exception as Exception import qualified Data.Text.IO-import qualified UnexceptionalIO   as UIO  -- | Fold an 'ExceptT' by providing one continuation for each constructor exceptT :: Monad m => (a -> m c) -> (b -> m c) -> ExceptT a m b -> m c@@ -276,5 +274,11 @@ {-| Catch all exceptions, except for asynchronous exceptions found in @base@     and convert them to the 'ExceptT' monad -}-syncIO :: Unexceptional m => IO a -> ExceptT SomeException m a-syncIO = ExceptT . UIO.liftUIO . UIO.fromIO+syncIO :: MonadIO m => IO a -> ExceptT SomeException m a+syncIO = ExceptT . liftIO . trySync++trySync :: IO a -> IO (Either SomeException a)+trySync io = (fmap Right io) `Exception.catch` \e ->+  case Exception.fromException e of+    Just (Exception.SomeAsyncException _) -> Exception.throwIO e+    Nothing -> return (Left e)
errors.cabal view
@@ -1,8 +1,8 @@ Name: errors-Version: 2.2.5+Version: 2.3.0 Cabal-Version: >=1.8.0.2 Build-Type: Simple-Tested-With: GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.2, GHC == 8.0.1+Tested-With: GHC == 7.8.4, GHC == 7.10.2, GHC == 8.0.1 License: BSD3 License-File: LICENSE Copyright: 2012, 2013 Gabriel Gonzalez@@ -24,12 +24,11 @@  Library     Build-Depends:-        base                >= 4     && < 5   ,+        base                >= 4.7   && < 5   ,         exceptions          >= 0.6   && < 0.11,         text                            < 1.3 ,         transformers        >= 0.2   && < 0.6 ,-        transformers-compat >= 0.4   && < 0.7 ,-        unexceptionalio     >= 0.3   && < 0.4+        transformers-compat >= 0.4   && < 0.7     if impl(ghc <= 7.6.3)         Build-Depends:             safe            >= 0.3.3 && < 0.3.10