@@ -46,7 +46,7 @@ import System.IO (Handle, IOMode(..), hPutChar, openFile, stdin, stdout,
46import qualified Data.ByteString.Char8 as B
46import qualified Data.ByteString.Char8 as B
47import Data.Text.Encoding (decodeUtf8, encodeUtf8)
47import Data.Text.Encoding (decodeUtf8, encodeUtf8)
49−import Control.Exception (catch, throw)
49+import Control.Exception (catch, throwIO)
50import Control.Monad (liftM2, when)
50import Control.Monad (liftM2, when)
51import Data.IORef (readIORef, writeIORef)
51import Data.IORef (readIORef, writeIORef)
52import qualified Data.Text as T
52import qualified Data.Text as T
@@ -123,7 +123,7 @@ hGetContents h = do
123 return $ if isEmptyBuffer buf
123 return $ if isEmptyBuffer buf
124 then T.empty
124 then T.empty
125 else T.singleton '\r'
125 else T.singleton '\r'
126− | otherwise = throw (augmentIOError e "hGetContents" h)
126+ | otherwise = throwIO (augmentIOError e "hGetContents" h)
127 readChunks = do
127 readChunks = do
128 buf <- readIORef haCharBuffer
128 buf <- readIORef haCharBuffer
129 t <- readChunk hh buf `catch` catchError
129 t <- readChunk hh buf `catch` catchError
@@ -147,7 +147,7 @@ chooseGoodBuffering h = do
147 d <- catch (liftM2 (-) (hFileSize h) (hTell h)) $ \(e::IOException) ->
147 d <- catch (liftM2 (-) (hFileSize h) (hTell h)) $ \(e::IOException) ->
148 if ioe_type e == InappropriateType
148 if ioe_type e == InappropriateType
149 then return 16384 -- faster than the 2KB default
149 then return 16384 -- faster than the 2KB default
150− else throw e
150+ else throwIO e
151 when (d > 0) . hSetBuffering h . BlockBuffering . Just . fromIntegral $ d
151 when (d > 0) . hSetBuffering h . BlockBuffering . Just . fromIntegral $ d
152 _ -> return ()
152 _ -> return ()