On Tue, Aug 24, 2010 at 7:16 PM, Gregory Collins <greg@gregorycollins.net>wrote:
John Lato <jwlato@gmail.com> writes:
Oleg included the error state to enable short-circuiting of computation, and I guess everyone just left it in. Recently I've been wondering if it should be removed, though, in favor requiring explicit (i.e. explicit in the type sig) exceptions for everything. I'm not sure if that would be more or less complicated.
If you don't want to go all the way to checked exceptions, MonadCatchIO could also be a nice way to go here.
Be *very* careful of combining MonadCatchIO and CPS: the MonadCatchIO instance for ContT does not perform correctly, and can call the exception handler twice. It might produce other erroneous behavior, but that was a bug that plagued me in persistent.
I would recommend looking at the failure package[1] for making the exceptions explicit in the type signature. Michael [1] http://hackage.haskell.org/package/failure