errors-ext-0.4.2: `bracket`-like functions for `ExceptT` over `IO` monad.

Safe HaskellSafe
LanguageHaskell2010

Control.Error.Extensions

Description

This module exports bracket-like functions for ExceptT e IO.

Synopsis

Documentation

bracketE :: (MonadBaseControl IO m, MonadError e m) => m a -> (a -> m b) -> (a -> m c) -> m c Source #

Analogous to bracket, but for ExceptT e IO (or any MonadError allowing bracket lifting).

bracketE_ :: (MonadBaseControl IO m, MonadError e m) => m a -> m b -> m c -> m c Source #

A variant of bracketE where the return value from the first computation is not required.

eitherMaybe :: Either () a -> Maybe a Source #

Converts Either to Maybe. Specialization of either.

maybeEither . eitherMaybe = id

maybeEither :: Maybe a -> Either () a Source #

Converts Maybe to Either. Specialization of maybe.

maybeEither . eitherMaybe = id

eitherVoidL :: Either Void a -> a Source #

Removes left zero term from sum type. Specialization of either.

eitherVoidR :: Either a Void -> a Source #

Removes right zero term from sum type. Specialization of either.