Safe Haskell | None |
---|

This module exports miscellaneous error-handling functions.

- hush :: Either a b -> Maybe b
- hushT :: Monad m => EitherT a m b -> MaybeT m b
- note :: a -> Maybe b -> Either a b
- noteT :: Monad m => a -> MaybeT m b -> EitherT a m b
- hoistMaybe :: Monad m => Maybe b -> MaybeT m b
- maybeT :: Monad m => m b -> (a -> m b) -> MaybeT m a -> m b
- just :: Monad m => a -> MaybeT m a
- nothing :: Monad m => MaybeT m a
- isLeft :: Either a b -> Bool
- isRight :: Either a b -> Bool
- fmapR :: (a -> b) -> Either l a -> Either l b
- fmapRT :: Monad m => (a -> b) -> EitherT l m a -> EitherT l m b
- err :: String -> IO ()
- errLn :: String -> IO ()
- tryIO :: MonadIO m => IO a -> EitherT IOException m a

# Conversion

Use these functions to convert between `Maybe`

, `Either`

, `MaybeT`

, and
`EitherT`

.

Note that `hoistEither`

is provided by the `either`

package.

# MaybeT

# Either

# EitherT

# Error Reporting

# Exceptions

tryIO :: MonadIO m => IO a -> EitherT IOException m aSource

Catch `IOException`

s and convert them to the `EitherT`

monad