Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Delegated failure.

  • Loading branch information...
commit d08b575d678417fd2c3be404c409073d99a26e02 1 parent 6081217
@ekmett authored
View
4 CHANGELOG.markdown
@@ -1,3 +1,7 @@
+3.4
+---
+* Delegate `fail` to the underlying `Monad`, rather than `error`.
+
3.3
---
* Inverted roles between `Semigroup` and `Alt`. This let us write `Alternative` and `MonadPlus` instances that are compatible.
View
2  either.cabal
@@ -1,6 +1,6 @@
name: either
category: Control, Monads
-version: 3.3
+version: 3.4
license: BSD3
cabal-version: >= 1.6
license-file: LICENSE
View
3  src/Control/Monad/Trans/Either.hs
@@ -184,6 +184,9 @@ instance Monad m => Monad (EitherT e m) where
Left l -> return (Left l)
Right r -> runEitherT (k r)
{-# INLINE (>>=) #-}
+ fail = EitherT . fail
+ {-# INLINE fail #-}
+
instance Monad m => MonadError e (EitherT e m) where
throwError = EitherT . return . Left
Please sign in to comment.
Something went wrong with that request. Please try again.