[project @ 2000-07-07 11:03:57 by simonmar]
authorsimonmar <unknown>
Fri, 7 Jul 2000 11:03:59 +0000 (11:03 +0000)
committersimonmar <unknown>
Fri, 7 Jul 2000 11:03:59 +0000 (11:03 +0000)
commit6151c960d6df040a5bfd94791f934969dfb55050
tree8df14d1e6fe1abcc6b6a4396d719b97fa6377284
parent219fbeccb52d15bacc54f88d422b172866dbd154
[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.
15 files changed:
ghc/lib/std/CPUTime.lhs
ghc/lib/std/Directory.lhs
ghc/lib/std/PrelArr.lhs
ghc/lib/std/PrelBase.lhs
ghc/lib/std/PrelByteArr.lhs
ghc/lib/std/PrelConc.lhs
ghc/lib/std/PrelException.hi-boot [deleted file]
ghc/lib/std/PrelException.lhs
ghc/lib/std/PrelHandle.lhs
ghc/lib/std/PrelIO.lhs
ghc/lib/std/PrelIOBase.lhs
ghc/lib/std/PrelPack.lhs
ghc/lib/std/PrelST.lhs
ghc/lib/std/System.lhs
ghc/rts/Prelude.h