Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- maybeFail :: Monad m => Maybe a -> m a
- eitherFailS :: Monad m => Either String a -> m a
- eitherFail :: (Show s, Monad m) => Either s a -> m a
- data NothingException = NothingException
- data LeftException = LeftException String
- maybeThrow :: Maybe a -> a
- eitherThrowS :: Either String a -> a
- eitherThrow :: Exception err => Either err a -> a
- eitherThrowWith :: Exception err => (x -> err) -> Either x a -> a
- optionally :: Monad m => (a -> m ()) -> Maybe a -> m ()
Documentation
data NothingException Source #
Instances
Show NothingException Source # | |
Defined in Control.MaybeEitherMonad showsPrec :: Int -> NothingException -> ShowS # show :: NothingException -> String # showList :: [NothingException] -> ShowS # | |
Exception NothingException Source # | |
Defined in Control.MaybeEitherMonad |
data LeftException Source #
Thrown when eitherFail
or eitherFailS
runs into a Left
Instances
Show LeftException Source # | |
Defined in Control.MaybeEitherMonad showsPrec :: Int -> LeftException -> ShowS # show :: LeftException -> String # showList :: [LeftException] -> ShowS # | |
Exception LeftException Source # | |
Defined in Control.MaybeEitherMonad |
maybeThrow :: Maybe a -> a Source #
Get Just
the value, or throw a NothingException
eitherThrowS :: Either String a -> a Source #
Get the Right
value, or throw a LeftException
eitherThrow :: Exception err => Either err a -> a Source #
Get the Right
value, or throw a LeftException
eitherThrowWith :: Exception err => (x -> err) -> Either x a -> a Source #