Gabriella439 / Gabriella439/Haskell-Errors-Library
bracket
Open
- Dominant language
- Haskell
- Stars
- 65
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
Description
What do you think about adding a mimicking of the `bracket` function of `Exception`?
It ensures that the `release` action is performed before any errors of the `apply` are raised.
``` haskell
bracket ::
(Monad m) =>
EitherT e m a ->
(a -> EitherT e m b) ->
(a -> EitherT e m c) ->
EitherT e m c
bracket acquire release apply = do
r <- acquire
z <- lift $ runEitherT $ apply r
release r
hoistEither z
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.