[project @ 2002-12-12 13:21:46 by ross]
authorross <unknown>
Thu, 12 Dec 2002 13:21:47 +0000 (13:21 +0000)
committerross <unknown>
Thu, 12 Dec 2002 13:21:47 +0000 (13:21 +0000)
Use ioError instead of throw for IOErrors, in anticipation of
a change from IOError = Exception to IOError = IOException.

ghc/compiler/ghci/InteractiveUI.hs
ghc/compiler/utils/Binary.hs

index aa82735..5801a38 100644 (file)
@@ -1,6 +1,6 @@
 {-# OPTIONS -#include "Linker.h" -#include "SchedAPI.h" #-}
 -----------------------------------------------------------------------------
--- $Id: InteractiveUI.hs,v 1.138 2002/12/05 12:36:54 simonmar Exp $
+-- $Id: InteractiveUI.hs,v 1.139 2002/12/12 13:21:46 ross Exp $
 --
 -- GHC Interactive User Interface
 --
@@ -295,7 +295,7 @@ fileLoop hdl prompt = do
    l <- io (IO.try (hGetLine hdl))
    case l of
        Left e | isEOFError e -> return ()
-              | otherwise    -> throw e
+              | otherwise    -> io (ioError e)
        Right l -> 
          case remove_spaces l of
            "" -> fileLoop hdl prompt
index 3ac01ea..2414067 100644 (file)
@@ -86,7 +86,7 @@ import Data.IORef
 import Data.Char               ( ord, chr )
 import Data.Array.Base         ( unsafeRead, unsafeWrite )
 import Control.Monad           ( when )
-import Control.Exception       ( throw, throwDyn )
+import Control.Exception       ( throwDyn )
 import System.IO as IO
 import System.IO.Unsafe                ( unsafeInterleaveIO )
 import System.IO.Error         ( mkIOError, eofErrorType )
@@ -297,7 +297,7 @@ getWord8 (BinMem _ ix_r sz_r arr_r) = do
     ix <- readFastMutInt ix_r
     sz <- readFastMutInt sz_r
     when (ix >= sz)  $
-       throw (mkIOError eofErrorType "Data.Binary.getWord8" Nothing Nothing)
+       ioError (mkIOError eofErrorType "Data.Binary.getWord8" Nothing Nothing)
     arr <- readIORef arr_r
     w <- unsafeRead arr ix
     writeFastMutInt ix_r (ix+1)