neither 0.0.1 → 0.0.2
raw patch · 2 files changed
+10/−2 lines, 2 filesdep +failurePVP ok
version bump matches the API change (PVP)
Dependencies added: failure
API changes (from Hackage documentation)
Files
- Data/Neither/Base.hs +7/−0
- neither.cabal +3/−2
Data/Neither/Base.hs view
@@ -1,8 +1,11 @@ {-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE MultiParamTypeClasses #-} module Data.Neither.Base where import Control.Applicative import Control.Monad+import Control.Failure import Data.Typeable import Data.Data import Data.Monoid@@ -18,6 +21,8 @@ instance Applicative (MEither a) where pure = return (<*>) = ap+instance Failure e (MEither e) where+ failure = MLeft meither :: (a -> c) -> (b -> c) -> MEither a b -> c meither f _ (MLeft a) = f a meither _ f (MRight b) = f b@@ -57,3 +62,5 @@ return = MEitherT . return . return (MEitherT x) >>= f = MEitherT $ x >>= meither (return . MLeft) (runMEitherT . f)+instance Monad m => Failure e (MEitherT e m) where+ failure = MEitherT . return . MLeft
neither.cabal view
@@ -1,5 +1,5 @@ name: neither-version: 0.0.1+version: 0.0.2 license: BSD3 license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>@@ -22,7 +22,8 @@ transformers >= 0.2.1 && < 0.3, MonadCatchIO-transformers >= 0.2.2 && < 0.3, mtl >= 1.1.0.2 && < 1.2,- MonadCatchIO-mtl >= 0.3.0.1 && < 0.4+ MonadCatchIO-mtl >= 0.3.0.1 && < 0.4,+ failure >= 0.1.0 && < 0.2 exposed-modules: Data.Neither other-modules: Data.Neither.Base Data.Neither.Class