[Haskell-cafe] Absolutely confused with error/exception handling
Saurabh Nanda
saurabhnanda at gmail.com
Sat Dec 17 03:46:00 UTC 2016
To generalise the problem, because I've encountered it in other places as
well, how does one write his/her own instance of MonadIO, MonadThrow, or
MonadCatch for complicated transformer stacks such has ActionCtxT?
On 17 Dec 2016 3:13 am, "Brandon Allbery" <allbery.b at gmail.com> wrote:
>
> On Fri, Dec 16, 2016 at 7:30 AM, Saurabh Nanda <saurabhnanda at gmail.com>
> wrote:
>
>>
>> How do I catch an exception coming out of an action in the ActionCtxT
>> monad?
>>
>
> I think I'm going to have to let someone else answer. I just got lost in
> MonadBaseControl, not to mention how you do this if all you have is the
> ActionCtxT and not the WebStateT where Spock actually handles exceptions. :/
>
> If it helps, exception handling is known to be a sewer --- because it
> can't be done in a clean and generic way without introducing significant
> resource leaks and other problems. And MonadBaseControl works when you (or
> the developer, in this case of Spock) define the right instances, but is
> doing it the hard way.
>
> --
> brandon s allbery kf8nh sine nomine
> associates
> allbery.b at gmail.com
> ballbery at sinenomine.net
> unix, openafs, kerberos, infrastructure, xmonad
> http://sinenomine.net
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20161217/9e9f2092/attachment.html>
More information about the Haskell-Cafe
mailing list