Copyright | (c) 2016-2017 Red Hat Inc. |
---|---|
License | LGPL |
Maintainer | https://github.com/weldr |
Stability | alpha |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
BDCS.Utils.Either
Description
Utility functions to help with Either values
- maybeToEither :: MonadError e m => e -> Maybe a -> m a
- whenLeft :: Monad m => Either e a -> (e -> m ()) -> m ()
- whenRight :: Monad m => Either e a -> (a -> m ()) -> m ()
Documentation
maybeToEither :: MonadError e m => e -> Maybe a -> m a Source #
Throw the passed err if the value is Nothing, otherwise return the value.