Generalizing Network.CGI exceptions to MonadCatchIO

Anders Kaseorg andersk at MIT.EDU
Mon Mar 15 16:59:06 EDT 2010


On Mon, 15 Mar 2010, Bas van Dijk wrote:
> What about deprecating all the cgi exception handling functions: 
> throwCGI, catchCGI and tryCGI in favor of the CatchIO ones?

Yeah, that’s basically the direction I want to go in.  This patch makes 
the new CatchIO functions work by adding a MonadCatchIO interface, without 
breaking the old ones (though the old ones get a little bit of 
generalization for free).

> The advantage: a simpler API.
> 
> The disadvantage: possible ambiguous type variables like you mentioned.

Since CGI doesn’t currently have a MonadCatchIO interface at all, that 
can’t be a compatibility problem.

(I checked anyway, just to be sure that none of the existing packages 
declare their own MonadCatchIO interface that would conflict with the one 
I’m adding.  There’s only one package (bff) that recursively depends on 
both cgi and MonadCatchIO, and it doesn’t mention MonadCatchIO directly.)

Anders


More information about the Libraries mailing list