Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Re-exports most useful functionality from 'safe-exceptions'. Also
provides some functions to work with exceptions over MonadError
.
- module Control.Exception.Safe
- data Bug = Bug SomeException CallStack
- bug :: (HasCallStack, Exception e) => e -> a
- note :: MonadError e m => e -> Maybe a -> m a
Documentation
module Control.Exception.Safe
Type that represents exceptions used in cases when a particular codepath is not meant to be ever executed, but happens to be executed anyway.
bug :: (HasCallStack, Exception e) => e -> a Source #
Generate a pure value which, when forced, will synchronously
throw the exception wrapped into Bug
data type.
note :: MonadError e m => e -> Maybe a -> m a Source #
Throws error for Maybe
if Nothing
is given.
Operates over MonadError
.