@@ -38,7 +38,7 @@ module Data.Text.IO
40import Data.Text (Text)
40import Data.Text (Text)
41−import Prelude hiding (appendFile, catch, getContents, getLine, interact,
41+import Prelude hiding (appendFile, getContents, getLine, interact,
42 putStr, putStrLn, readFile, writeFile)
42 putStr, putStrLn, readFile, writeFile)
43import System.IO (Handle, IOMode(..), hPutChar, openFile, stdin, stdout,
43import System.IO (Handle, IOMode(..), hPutChar, openFile, stdin, stdout,
@@ -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, throwIO)
49+import qualified Control.Exception as E
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,10 +123,10 @@ 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 = throwIO (augmentIOError e "hGetContents" h)
126+ | otherwise = E.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 `E.catch` catchError
130 if T.null t
130 if T.null t
131 then return [t]
131 then return [t]
132 else (t:) `fmap` readChunks
132 else (t:) `fmap` readChunks
@@ -144,10 +144,10 @@ chooseGoodBuffering h = do
144 bufMode <- hGetBuffering h
144 bufMode <- hGetBuffering h
145 case bufMode of
145 case bufMode of
146 BlockBuffering Nothing -> do
146 BlockBuffering Nothing -> do
147− d <- catch (liftM2 (-) (hFileSize h) (hTell h)) $ \(e::IOException) ->
147+ d <- E.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 throwIO e
150+ else E.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 ()