Proposal: add Control.Exception.SomeAsyncException

Roman Cheplyaka roma at
Wed Feb 5 08:56:45 UTC 2014

It is often useful to distinguish between synchronous and asynchronous
exceptions. The common idiom is to run a user-supplied computation
catching any synchronous exceptions but allowing asynchronous exceptions
(such as user interrupt) pass through.

There's no way to know how — synchronously or asynchronously — an
exception was thrown, so we have to work around it by relying on the
exception type itself.

Unfortunately, the AsyncException type was designed as a leaf in the
exceptions hierarchy, so it's not possible to extend it with
user-defined asynchronous exception types.

Thus I propose to add SomeAsyncException as an extensible type ("class")
of asynchronous exceptions. It will be a direct subclass of
SomeException, and will become the superclass of the existing
AsyncException type.

Users can then define their own asynchronous exceptions by subclassing

My main motivation for this change is exceptions used for timeouts. So
the second part of this proposal it to mark System.Timeout.Timeout as an
asynchronous exception.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <>

More information about the Libraries mailing list