universum-1.0.2: Custom prelude used in Serokell

Safe HaskellSafe
LanguageHaskell2010

Universum.Exception

Description

Re-exports most useful functionality from 'safe-exceptions'. Also provides some functions to work with exceptions over MonadError.

Synopsis

Documentation

data Bug Source #

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.