Safe Haskell | None |
---|---|
Language | Haskell2010 |
Bitgram's general-purpose exceptions. They may be useful when you need a simple instance of Exception (e. g. in MonadThrow context)
- newtype TextException = TextException {}
- throwText :: MonadThrow m => Text -> m a
- data EmptyException = EmptyException
- throwEmpty :: MonadThrow m => m a
- eitherToFail :: (Monad m, e ~ SomeException) => Either e a -> m a
Documentation
newtype TextException Source #
Use this type if you are sure that text description is enough to represent error
throwText :: MonadThrow m => Text -> m a Source #
data EmptyException Source #
Use this type if you want to signal about error and there may be only one reason for it
throwEmpty :: MonadThrow m => m a Source #
eitherToFail :: (Monad m, e ~ SomeException) => Either e a -> m a Source #
Convert MonadThrow to arbitrary monad using fail
to report
error Useful when you have MonadThrow
and want to use it in
another monad context which uses fail
for errors