packages feed

errors 2.2.2 → 2.2.3

raw patch · 3 files changed

+35/−8 lines, 3 filesdep ~basedep ~transformers-compatPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base, transformers-compat

API changes (from Hackage documentation)

+ Control.Error.Util: instance (Data.Semigroup.Semigroup e, Data.Semigroup.Semigroup r) => Data.Semigroup.Semigroup (Control.Error.Util.AllE e r)
+ Control.Error.Util: instance (Data.Semigroup.Semigroup e, Data.Semigroup.Semigroup r) => Data.Semigroup.Semigroup (Control.Error.Util.AnyE e r)

Files

CHANGELOG.md view
@@ -1,3 +1,7 @@+# 2.2.3++* Increase upper bound on `transformers-compat`+ # 2.2.2  * Support GHC 8.4 through compatibility with Semigroup/Monoid proposal
Control/Error/Util.hs view
@@ -1,3 +1,5 @@+{-# LANGUAGE CPP #-}+ -- | This module exports miscellaneous error-handling functions.  module Control.Error.Util (@@ -52,19 +54,20 @@     ) where  import Control.Applicative (Applicative, pure, (<$>))-import Control.Exception (Handler(..), IOException, SomeException, Exception)+import Control.Exception (IOException, SomeException, Exception) import Control.Monad (liftM) import Control.Monad.Catch (MonadCatch, try) import Control.Monad.IO.Class (MonadIO(liftIO))-import Control.Monad.Trans.Except (ExceptT(ExceptT), runExceptT, withExceptT)+import Control.Monad.Trans.Except (ExceptT(ExceptT), runExceptT) import Control.Monad.Trans.Maybe (MaybeT(MaybeT), runMaybeT)-import Data.Dynamic (Dynamic) import Data.Monoid (Monoid(mempty, mappend))+#if MIN_VERSION_base(4,9,0)+import Data.Semigroup+#endif import Data.Maybe (fromMaybe) import Data.Text (Text)-import System.Exit (ExitCode)-import System.IO (hPutStr, hPutStrLn, stderr)-import UnexceptionalIO (UIO, Unexceptional)+import System.IO (stderr)+import UnexceptionalIO (Unexceptional)  import qualified Control.Exception as Exception import qualified Data.Text.IO@@ -197,12 +200,22 @@ -} newtype AllE e r = AllE { runAllE :: Either e r } +#if MIN_VERSION_base(4,9,0)+instance (Semigroup e, Semigroup r) => Semigroup (AllE e r) where+    AllE (Right x) <> AllE (Right y) = AllE (Right (x <> y))+    AllE (Right _) <> AllE (Left  y) = AllE (Left y)+    AllE (Left  x) <> AllE (Right _) = AllE (Left x)+    AllE (Left  x) <> AllE (Left  y) = AllE (Left  (x <> y))+#endif+ instance (Monoid e, Monoid r) => Monoid (AllE e r) where     mempty = AllE (Right mempty)+#if !(MIN_VERSION_base(4,11,0))     mappend (AllE (Right x)) (AllE (Right y)) = AllE (Right (mappend x y))     mappend (AllE (Right _)) (AllE (Left  y)) = AllE (Left y)     mappend (AllE (Left  x)) (AllE (Right _)) = AllE (Left x)     mappend (AllE (Left  x)) (AllE (Left  y)) = AllE (Left  (mappend x y))+#endif  {-| Run multiple 'Either' computations and succeed if any of them succeed @@ -210,12 +223,22 @@ -} newtype AnyE e r = AnyE { runAnyE :: Either e r } +#if MIN_VERSION_base(4,9,0)+instance (Semigroup e, Semigroup r) => Semigroup (AnyE e r) where+    AnyE (Right x) <> AnyE (Right y) = AnyE (Right (x <> y))+    AnyE (Right x) <> AnyE (Left  _) = AnyE (Right x)+    AnyE (Left  _) <> AnyE (Right y) = AnyE (Right y)+    AnyE (Left  x) <> AnyE (Left  y) = AnyE (Left  (x <> y))+#endif+ instance (Monoid e, Monoid r) => Monoid (AnyE e r) where     mempty = AnyE (Right mempty)+#if !(MIN_VERSION_base(4,11,0))     mappend (AnyE (Right x)) (AnyE (Right y)) = AnyE (Right (mappend x y))     mappend (AnyE (Right x)) (AnyE (Left  _)) = AnyE (Right x)     mappend (AnyE (Left  _)) (AnyE (Right y)) = AnyE (Right y)     mappend (AnyE (Left  x)) (AnyE (Left  y)) = AnyE (Left  (mappend x y))+#endif  -- | Analogous to 'isLeft', but for 'ExceptT' isLeftT :: (Monad m) => ExceptT a m b -> m Bool
errors.cabal view
@@ -1,5 +1,5 @@ Name: errors-Version: 2.2.2+Version: 2.2.3 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@@ -28,7 +28,7 @@         exceptions          >= 0.6   && < 0.9,         text                            < 1.3,         transformers        >= 0.2   && < 0.6,-        transformers-compat >= 0.4   && < 0.6,+        transformers-compat >= 0.4   && < 0.7,         unexceptionalio     >= 0.3   && < 0.4     if impl(ghc <= 7.6.3)         Build-Depends: