[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.
Showing
- ghc/lib/std/CPUTime.lhs 8 additions, 5 deletionsghc/lib/std/CPUTime.lhs
- ghc/lib/std/Directory.lhs 8 additions, 5 deletionsghc/lib/std/Directory.lhs
- ghc/lib/std/PrelArr.lhs 1 addition, 4 deletionsghc/lib/std/PrelArr.lhs
- ghc/lib/std/PrelBase.lhs 1 addition, 5 deletionsghc/lib/std/PrelBase.lhs
- ghc/lib/std/PrelByteArr.lhs 1 addition, 3 deletionsghc/lib/std/PrelByteArr.lhs
- ghc/lib/std/PrelConc.lhs 7 additions, 6 deletionsghc/lib/std/PrelConc.lhs
- ghc/lib/std/PrelException.hi-boot 0 additions, 12 deletionsghc/lib/std/PrelException.hi-boot
- ghc/lib/std/PrelException.lhs 19 additions, 132 deletionsghc/lib/std/PrelException.lhs
- ghc/lib/std/PrelHandle.lhs 56 additions, 35 deletionsghc/lib/std/PrelHandle.lhs
- ghc/lib/std/PrelIO.lhs 10 additions, 9 deletionsghc/lib/std/PrelIO.lhs
- ghc/lib/std/PrelIOBase.lhs 343 additions, 243 deletionsghc/lib/std/PrelIOBase.lhs
- ghc/lib/std/PrelPack.lhs 1 addition, 2 deletionsghc/lib/std/PrelPack.lhs
- ghc/lib/std/PrelST.lhs 1 addition, 2 deletionsghc/lib/std/PrelST.lhs
- ghc/lib/std/System.lhs 13 additions, 10 deletionsghc/lib/std/System.lhs
- ghc/rts/Prelude.h 11 additions, 11 deletionsghc/rts/Prelude.h
Loading
Please register or sign in to comment