Fork me on GitHub
#funcool
<
2016-07-14
>
luxbock10:07:21

is there an easy way to convert values between the Exception and Either monads inside a mlet block?

luxbock10:07:43

I have some functions which I've wrapped to return Lefts and some functions where I'd like to treat an exception thrown as Failure's, and I'd like to thread these inside mlet returning a Right or Left

luxbock10:07:14

I was hoping that if I use the Either-context then it would do the conversion for me

mattly21:07:22

@luxbock: it looks the forthcoming cats 2.0 release includes either/try-either which would replace your use case

mattly21:07:42

.. and I hope it's getting released soon

mattly21:07:01

I'm giving a presentation on cats at my local clojure group next month 😄