Use ioError instead of throw for IOErrors, in anticipation of
a change from IOError = Exception to IOError = IOException.
{-# OPTIONS -#include "Linker.h" -#include "SchedAPI.h" #-}
-----------------------------------------------------------------------------
{-# 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
--
--
-- GHC Interactive User Interface
--
l <- io (IO.try (hGetLine hdl))
case l of
Left e | isEOFError e -> return ()
l <- io (IO.try (hGetLine hdl))
case l of
Left e | isEOFError e -> return ()
+ | otherwise -> io (ioError e)
Right l ->
case remove_spaces l of
"" -> fileLoop hdl prompt
Right l ->
case remove_spaces l of
"" -> fileLoop hdl prompt
import Data.Char ( ord, chr )
import Data.Array.Base ( unsafeRead, unsafeWrite )
import Control.Monad ( when )
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 )
import System.IO as IO
import System.IO.Unsafe ( unsafeInterleaveIO )
import System.IO.Error ( mkIOError, eofErrorType )
ix <- readFastMutInt ix_r
sz <- readFastMutInt sz_r
when (ix >= sz) $
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)
arr <- readIORef arr_r
w <- unsafeRead arr ix
writeFastMutInt ix_r (ix+1)