RlpcError
This commit is contained in:
@@ -6,6 +6,7 @@ module Control.Monad.Errorful
|
||||
, runErrorfulT
|
||||
, Errorful
|
||||
, runErrorful
|
||||
, mapErrors
|
||||
, MonadErrorful(..)
|
||||
)
|
||||
where
|
||||
@@ -63,3 +64,10 @@ instance (Monad m) => Monad (ErrorfulT e m) where
|
||||
Right (a,es) -> runErrorfulT (k a)
|
||||
Left e -> pure (Left e)
|
||||
|
||||
mapErrors :: (Monad m) => (e -> e') -> ErrorfulT e m a -> ErrorfulT e' m a
|
||||
mapErrors f m = ErrorfulT $ do
|
||||
x <- runErrorfulT m
|
||||
case x of
|
||||
Left e -> pure . Left $ f e
|
||||
Right (a,es) -> pure . Right $ (a, f <$> es)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user