Safe Haskell | Safe-Infered |
---|
Control.Error.Util
Contents
Description
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
- isLeft :: Either a b -> Bool
- isRight :: Either a b -> Bool
- fmapR :: (a -> b) -> Either l a -> Either l b
- fmapRT :: Functor 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.
Either
EitherT
Error Reporting
Exceptions
tryIO :: MonadIO m => IO a -> EitherT IOException m aSource
Catch IOException
s and convert them to the EitherT
monad