Control.Exception

Thomas Schilling nominolo at googlemail.com
Tue Oct 7 10:25:50 EDT 2008


2008/10/7 Johannes Waldmann <waldmann at imn.htwk-leipzig.de>:
> 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'

catch \(e :: SomeException) -> ...
This requires language ScopedTypeVariables (and perhaps PatternSignatures).

Of cause, you should try to be more specific about which exceptions
you want to catch as e.g., Ctrl-C and many other things are also
reported as exceptions.

>
> It is probably bad programming style anyway but what is the workaround?
> I found some references (in list emails) to catchAny, ignoreExceptions
> but these don't seem to have made it?
>
> Best regards, J.W.
>
>
> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
>


More information about the Glasgow-haskell-users mailing list