Proposal: merge either into transformers
Erik de Castro Lopo
mle+hs at mega-nerd.com
Tue Jan 3 07:59:09 UTC 2017
Edward Kmett wrote:
> If you can get the extra combinators into transformers, I might be able to
> offer a C.M.T.E.Compat module that you could import along with C.M.T.E to
> get the new API across those intermediate versions, but I've yet to adopt
> this practice for the other transformers modules. If someone wanted to toss
> a patch at transformers-compat that added .Compat modules with the changes
> to the transformers API over time, (like adding reader, state, writer
> combinators), I'd probably take the patch, but I don't have a definitive
> list of what they are and the design would involve some compromises.
I found another solution.
Gabriel Gonzalez's errors package already had much of what I needed and he
accepted a PR today to add:
handleExceptT :: (Exception e, Functor m, MonadCatch m) => (e -> x) -> m a -> ExceptT x m a
handleExceptT handler = bimapExceptT handler id . ExceptT . try
The names Gabriel uses are slightly different from what I'm used to
but the types are as expected :).
Cheers,
Erik
--
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/
More information about the Libraries
mailing list