[Haskell-cafe] Re: How to use Control.Failure?

ntupel ntupel at googlemail.com
Sat Dec 19 16:30:04 EST 2009

On Dec 19, 5:14 pm, Michael Snoyman <mich... at snoyman.com> wrote:
> Well, here's one way of doing it. You have lots of choices here; these are
> the decisions I made in implementing the code:
> * myFuncB no longer lives in the IO monad. I wasn't sure if you specifically
> wanted that, but now it can work with *any* instance of Failure.
> * Since I assumed you ultimately wanted it to land in the IO monad, I
> defined Exception instances. However, if you were dealing with a different
> Failure instance (like [] or Maybe), these would be unncesary.
> * I also assume that what you meant by "your code" and "their code" is that
> you can modify your own code, but not theirs.
> If you show me what the real code is you're working on, I'd be happy to more
> fully develop a better solution with you. Anyway, here's the code.

Thank you very much. This helped a lot. I wasn't aware of many of the
details you showed me now, such as deriving from Typeable. The
assumptions you have made w.r.t to what I want to write all make sense
and I guess I can experiment with Control.Failure a little better now.

Thanks again,

More information about the Haskell-Cafe mailing list