Safe Haskell | Safe-Inferred |
---|

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
- (??) :: Applicative m => Maybe a -> e -> EitherT e m a
- (!?) :: Applicative m => m (Maybe a) -> e -> EitherT e m a
- 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
- syncIO :: MonadIO m => IO a -> EitherT SomeException m a

# Conversion

Use these functions to convert between `Maybe`

, `Either`

, `MaybeT`

, and
`EitherT`

.

Note that `hoistEither`

and `eitherT`

are provided by the `either`

package.

(??) :: Applicative m => Maybe a -> e -> EitherT e m aSource

(!?) :: Applicative m => m (Maybe a) -> e -> EitherT e m aSource

# 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