Control.Exception

Simon Marlow marlowsd at gmail.com
Tue Nov 4 05:47:13 EST 2008


Jason Dagit wrote:
> On Mon, Nov 3, 2008 at 6:24 AM, Simon Marlow <marlowsd at gmail.com> wrote:
>> Jason Dagit wrote:
>>> On Wed, Oct 8, 2008 at 1:19 AM, Simon Marlow <marlowsd at gmail.com> wrote:
>>>> Johannes Waldmann wrote:
>>>>> with 6.10, the following does not typecheck:
>>>>>
>>>>> foo `Control.Exception.catch` \ _ -> return bar
>>>>>
>>>>> Ambiguous type variable `e' in the constraint:
>>>>>     `Control.Exception.Exception e'
>>>>>
>>>>> It is probably bad programming style anyway but what is the workaround?
>>>> As long as you're aware that it is bad programming style.  We
>>>> deliberately
>>>> didn't include an easy way to do this, because we want people to think
>>>> about
>>>> why they need to catch *all* exceptions (most of the time it's a bug).
>>> Since the above is bad form, what should I be doing?  Could someone
>>> please provide some examples or point me at the list of exceptions
>>> that I can catch?  What about catching multiple types of exceptions?
>> Let's distinguish two kinds of exception handling:
> 
> Thanks.  This helps a lot.  Mind if I put it somewhere, such as on the wiki?

A good description of how to deal with exceptions would be great to have in 
the Haddock documentation for Control.Exception - would you (or someone 
else) like to write and submit a patch?  Or failing that, just putting it 
on the wiki would be useful too.

Cheers,
	Simon


More information about the Glasgow-haskell-users mailing list