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

Isaac Dupree ml at isaac.cedarswampstudios.org
Mon Dec 27 19:25:18 CET 2010


On 12/27/10 08:37, Henning Thielemann wrote:
>
> On Mon, 27 Dec 2010, Ian Lynagh wrote:
>
>>
>> Hi all,
>>
>> Deprecate and remove Prelude.catch and System.IO.Error.{catch,try}
>> http://hackage.haskell.org/trac/ghc/ticket/4865
>>
>> 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.
>
> This would mean, that Control.Exception.catch remains, that catches also
> the non-exception "undefined".

Today's Control.Exception.catch can easily catch only IOErrors (and in 
fact its catch-everything mode with SomeException is a nigh-deprecated 
mode of operation).

e `Control.Exception.catch` (\e -> ... e::IOException ...)

(IOError is a type synonym for IOException -- you can use either.)



More information about the Libraries mailing list