Safe Haskell | Safe |
---|---|

Language | Haskell2010 |

## Synopsis

- bracketE :: (MonadBaseControl IO m, MonadError e m) => m a -> (a -> m b) -> (a -> m c) -> m c
- bracketE_ :: (MonadBaseControl IO m, MonadError e m) => m a -> m b -> m c -> m c
- eitherMaybe :: Either () a -> Maybe a
- maybeEither :: Maybe a -> Either () a
- eitherVoidL :: Either Void a -> a
- eitherVoidR :: Either a Void -> a

# Documentation

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

Analogous to `bracket`

, but for

(or any `ExceptT`

e `IO`

`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`