Skip to content
Snippets Groups Projects
Commit 6151c960 authored by Simon Marlow's avatar Simon Marlow
Browse files

[project @ 2000-07-07 11:03:57 by simonmar]

Rearrange exception stuff, as per my message on glasgow-haskell-users
recently.

The main change is the IOError type is now a synonym for Exception.
IO.ioError can therefore be used for throwing exceptions.  IO.catch
still catches only IO exceptions, for backwards compatibility.

The interface exported by Exception has changed somewhat:

	try       :: IO a -> IO (Either Exception a)
	tryJust   :: (Exception -> Maybe b) -> a    -> IO (Either b a)

	catch     :: IO a -> (Exception -> IO a) -> IO a
	catchJust :: (Exception -> Maybe b) -> IO a -> (b -> IO a) -> IO a

	ioErrors		:: Exception -> Maybe IOError
	arithExceptions 	:: Exception -> Maybe ArithException
	errorCalls		:: Exception -> Maybe String
	dynExceptions		:: Exception -> Maybe Dynamic
	assertions		:: Exception -> Maybe String
	asyncExceptions 	:: Exception -> Maybe AsyncException

raiseInThread is now called throwTo.

Where possible, the old functions have been left around, but marked
deprecated.
parent 219fbecc
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment