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

Henning Thielemann lemming at
Wed Jan 5 22:22:34 CET 2011

Isaac Dupree schrieb:
> On 01/05/11 00:07, Isaac Dupree wrote:
>> On 01/04/11 13:20, Ian Lynagh wrote:
>>> GHC actually can't currently deprecate one export of 'catch' but not the
>>> other. Because of this, and because of the possible confusion etc with
>>> having 2 'catch' functions, I suggest we add catchIO and tryIO to
>>> System.IO.Error too. This will also give the new report a catch function
>>> it can refer to without having to worry about existential
>>> quantification etc.
>> Noooooooooooooooooo! Then "throwIO" will throw an exception and
>> "catchIO" won't catch it. I will feel horribly confused; or at least
>> some people probably will. Thoughts?
> Perhaps "catchIOError" and "tryIOError"?  (I suggest "*IOError" not
> "*IOException" for consistency with the other functions in
> System.IO.Error, but "catchIOException" is fine with me too.)

Dear Haskell programmers ... Mind you that Haskell has a nice module
system that allows qualified import. :-)

import qualified System.IO.Error as IOErr

main =
   ... IOErr.catch ...

is the best we can have. Why changing the name 'catch' to 'catchIOError'
in order to support unqualified import?

More information about the Libraries mailing list