From: ross Date: Thu, 12 Dec 2002 13:21:47 +0000 (+0000) Subject: [project @ 2002-12-12 13:21:46 by ross] X-Git-Tag: Approx_11550_changesets_converted~1355 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=dc813469cfae2d6ae2defe44bf014faf3ded2b32 [project @ 2002-12-12 13:21:46 by ross] Use ioError instead of throw for IOErrors, in anticipation of a change from IOError = Exception to IOError = IOException. --- diff --git a/ghc/compiler/ghci/InteractiveUI.hs b/ghc/compiler/ghci/InteractiveUI.hs index aa82735..5801a38 100644 --- a/ghc/compiler/ghci/InteractiveUI.hs +++ b/ghc/compiler/ghci/InteractiveUI.hs @@ -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 diff --git a/ghc/compiler/utils/Binary.hs b/ghc/compiler/utils/Binary.hs index 3ac01ea..2414067 100644 --- a/ghc/compiler/utils/Binary.hs +++ b/ghc/compiler/utils/Binary.hs @@ -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)