1. Bryan O'Sullivan
  2. text


Bryan O'Sullivan  committed 8018b8b

Use the right versions of catch and throw.

  • Participants
  • Parent commits a333943
  • Branches default

Comments (0)

Files changed (2)

File Data/Text/IO/Internal.hs

View file
     ) where
 #if __GLASGOW_HASKELL__ >= 612
+import Control.Exception (catch)
 import Data.IORef (readIORef, writeIORef)
 import Data.Text (Text)
 import Data.Text.Fusion (unstream)
                       withRawBuffer, writeCharBuf)
 import GHC.IO.Handle.Internals (ioe_EOF, readTextDevice, wantReadableHandle_)
 import GHC.IO.Handle.Types (Handle__(..), Newline(..))
+import Prelude hiding (catch)
 import System.IO (Handle)
 import System.IO.Error (isEOFError)
 import qualified Data.Text as T

File Data/Text/Lazy/IO.hs

View file
     ) where
 import Data.Text.Lazy (Text)
-import Prelude hiding (appendFile, getContents, getLine, interact, putStr,
-                       putStrLn, readFile, writeFile)
+import Prelude hiding (appendFile, catch, getContents, getLine, interact,
+                       putStr, putStrLn, readFile, writeFile)
 import System.IO (Handle, IOMode(..), hPutChar, openFile, stdin, stdout,
 import qualified Data.Text.IO as T
 import qualified Data.ByteString.Char8 as S8
 import qualified Data.ByteString.Lazy.Char8 as L8
-import Control.Exception (throw)
+import Control.Exception (catch, throwIO)
 import Control.Monad (when)
 import Data.IORef (readIORef)
 import Data.Text.IO.Internal (hGetLineWith, readChunk)
            then return $ if isEmptyBuffer buf
                          then (hh', empty)
                          else (hh', L.singleton '\r')
-           else throw (augmentIOError e "hGetContents" h)
+           else throwIO (augmentIOError e "hGetContents" h)
 -- | Read a single line from a handle.