IOError vs. Exception vs. IOException

Ross Paterson ross@soi.city.ac.uk
Mon, 4 Nov 2002 09:52:02 +0000


On Mon, Nov 04, 2002 at 08:57:06AM -0000, Simon Peyton-Jones wrote:
> 
> | FWIW, I agree with you, and I don't have any objections to changing it
> | (but Simon P.J. might).
> 
> I doubt I'd have an objection.  Want to make a concrete proposal to the
> libraries list?  I didn't get exactly what it was from your messages.

[redirecting to libraries]
Two (mostly) independent proposals:

1) Move bracket and bracket_ from System.IO (or GHC.Exception) to
   haskell98/IO.hs.  These two should now never be used anyway (except
   in all-H98 programs), and this would save users of the new libraries
   from having to hide them.

2) Define

	type IOError = IOException	-- was Exception

   (or vice versa), leave the type of Prelude.ioError as IOError -> IO a,
   but add to Control.Exception

	throwIO :: Exception -> IO a

If both are done, the only overlap seen by users of the new libraries
is Prelude.catch vs Control.Exception.catch and System.IO.try vs
Control.Exception.try.  In each case there's a type distinction
reflecting the semantic distinction.