
On Mon, Mar 15, 2010 at 8:37 PM, Anders Kaseorg
(It would be possible to generalize the types even further, from SomeException to Exception e => e, but I’m worried about introducing ambiguous type variables into existing code. After this patch, new code can just use the Control.Monad.CatchIO functions directly to deal with Exception e => e.)
(Note I'm not a user of the cgi package so don't take the following to seriously) What about deprecating all the cgi exception handling functions: throwCGI, catchCGI and tryCGI in favor of the CatchIO ones? The advantage: a simpler API. The disadvantage: possible ambiguous type variables like you mentioned. However, these can usually be resolved using a simple type annotation in your exception handler. Maybe somebody can analyze the reverse dependencies of cgi to see if any ambiguities will actually arise: http://bifunctor.homelinux.net/~roel/cgi-bin/hackage-scripts/revdeps/cgi-300... regards, Bas P.S. It would also be a good idea to rename the section "Error handling" to "Exception handling" because of: http://haskell.org/haskellwiki/Error_vs._Exception