either 3.0 → 3.0.1
raw patch · 3 files changed
+28/−2 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Control.Monad.Trans.Either: left :: Monad m => e -> EitherT e m a
+ Control.Monad.Trans.Either: right :: Monad m => a -> EitherT e m a
Files
- Control/Monad/Trans/Either.hs +11/−0
- README.markdown +15/−0
- either.cabal +2/−2
Control/Monad/Trans/Either.hs view
@@ -3,6 +3,8 @@ ( EitherT(..) , eitherT , hoistEither+ , left+ , right ) where import Control.Applicative@@ -42,8 +44,17 @@ Left a -> f a Right b -> g b +left :: Monad m => e -> EitherT e m a+left = EitherT . return . Left+{-# INLINE left #-}++right :: Monad m => a -> EitherT e m a+right = return+{-# INLINE right #-}+ hoistEither :: Monad m => Either e a -> EitherT e m a hoistEither = EitherT . return+{-# INLINE hoistEither #-} instance Functor m => Functor (EitherT e m) where fmap f = EitherT . fmap (fmap f) . runEitherT
+ README.markdown view
@@ -0,0 +1,15 @@+either+======++[](http://travis-ci.org/ekmett/either)++This provides an either monad transformer that unlike ErrorT is unencumbered by a constraint on its left hand argument. This is needed for a number of applications of this monad transformer, notably in recursion schemes.++Contact Information+-------------------++Contributions and bug reports are welcome!++Please feel free to contact me through github or on the #haskell IRC channel on irc.freenode.net.++-Edward Kmett
either.cabal view
@@ -1,6 +1,6 @@ name: either category: Control, Monads-version: 3.0+version: 3.0.1 license: BSD3 cabal-version: >= 1.6 license-file: LICENSE@@ -13,7 +13,7 @@ synopsis: Haskell 98 either monad transformer description: Haskell 98 either monad transformer build-type: Simple-extra-source-files: .travis.yml+extra-source-files: .travis.yml README.markdown source-repository head type: git