packages feed

either 4.1.2 → 4.3

raw patch · 3 files changed

+28/−4 lines, 3 filesdep +exceptionsdep +freedep ~basedep ~transformers-basePVP ok

version bump matches the API change (PVP)

Dependencies added: exceptions, free

Dependency ranges changed: base, transformers-base

API changes (from Hackage documentation)

+ Control.Monad.Trans.Either: instance (Functor f, MonadFree f m) => MonadFree f (EitherT e m)
+ Control.Monad.Trans.Either: instance MonadCatch m => MonadCatch (EitherT e m)
+ Control.Monad.Trans.Either: instance MonadThrow m => MonadThrow (EitherT e m)

Files

CHANGELOG.markdown view
@@ -1,3 +1,11 @@+4.3+---+* Inverted dependency between `free` and `either`.++4.2+---+* Added instances for `MonadThrow`, `MonadCatch`.+ 4.1 --- * Added instances for `MonadBase`, `MonadBaseControl`, and `MonadTransControl`.
either.cabal view
@@ -1,6 +1,6 @@ name:          either category:      Control, Monads-version:       4.1.2+version:       4.3 license:       BSD3 cabal-version: >= 1.6 license-file:  LICENSE@@ -28,13 +28,15 @@ library   build-depends:     base              >= 4       && < 5,-    monad-control     >= 0.3.2,+    exceptions        >= 0.5     && < 0.7,+    free              >= 4.9     && < 5,+    monad-control     >= 0.3.2   && < 0.4,     MonadRandom       == 0.1.*,     mtl               >= 2.0     && < 2.3,     semigroups        >= 0.8.3.1 && < 1,     semigroupoids     >= 4       && < 5,     transformers      >= 0.2     && < 0.5,-    transformers-base >= 0.4+    transformers-base >= 0.4     && < 0.5    extensions: CPP   exposed-modules: Control.Monad.Trans.Either
src/Control/Monad/Trans/Either.hs view
@@ -36,6 +36,8 @@ import Control.Monad.Base (MonadBase(..), liftBaseDefault) import Control.Monad.Cont.Class import Control.Monad.Error.Class+import Control.Monad.Free.Class+import Control.Monad.Catch import Control.Monad.Fix import Control.Monad.IO.Class import Control.Monad.Reader.Class@@ -195,7 +197,6 @@   fail = EitherT . fail   {-# INLINE fail #-} - instance Monad m => MonadError e (EitherT e m) where   throwError = EitherT . return . Left   {-# INLINE throwError #-}@@ -204,6 +205,16 @@     Right r -> return (Right r)   {-# INLINE catchError #-} +-- | Throws exceptions into the base monad.+instance MonadThrow m => MonadThrow (EitherT e m) where+  throwM = lift . throwM+  {-# INLINE throwM #-}++-- | Catches exceptions from the base monad.+instance MonadCatch m => MonadCatch (EitherT e m) where+  catch (EitherT m) f = EitherT $ catch m (runEitherT . f)+  {-# INLINE catch #-}+ instance MonadFix m => MonadFix (EitherT e m) where   mfix f = EitherT $ mfix $ \a -> runEitherT $ f $ case a of     Right r -> r@@ -263,6 +274,9 @@ instance Foldable m => Foldable (EitherT e m) where   foldMap f = foldMap (either mempty f) . runEitherT   {-# INLINE foldMap #-}++instance (Functor f, MonadFree f m) => MonadFree f (EitherT e m) where+  wrap = EitherT . wrap . fmap runEitherT  instance (Monad f, Traversable f) => Traversable (EitherT e f) where   traverse f (EitherT a) =