Proposal: Deprecate and remove Prelude.catch and System.IO.Error.{catch,try}

Ross Paterson ross at
Mon Dec 27 19:52:53 CET 2010

On Mon, Dec 27, 2010 at 12:36:33PM +0000, Ian Lynagh wrote:
> Prelude and System.IO.Error both export an old version of catch, which
> only catches IOError's, and System.IO.Error additionally exports try
> with the same problem.
> These exports are annoying for people who want to use the modern
> exception handling functions in Control.Exception, as you need to
> explicitly either import the Prelude with catch hidden, or give the
> module of the function you want to use.
> They may also be confusing for beginners, who may not expect to have to
> use anything other than the catch function in the default scope to catch
> all exceptions.
> I believe these functions are only there for historical reasons, and are
> old cruft that we should tidy up, so I propose that in the base package
> that comes with GHC 7.2 we deprecate these old functions, and in 7.4 we
> remove them.

The case for removing Prelude.catch is stronger than the one for removing
System.IO.Error.{catch,try} -- the new exception interface is not ready
for standardization because it relies on existential types and because of
concerns over catching asynchronous exceptions.

More information about the Libraries mailing list