From: Ian Lynagh Date: Sat, 18 Dec 2010 21:35:53 +0000 (+0000) Subject: Replace uses of the old catch function with the new one X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=b93d6da530a539bc3aa68816d1998e8826c40345;hp=938137ef0feb20656a745ae3e34803de3a825515;p=ghc-base.git Replace uses of the old catch function with the new one --- diff --git a/GHC/IO/Handle/Text.hs b/GHC/IO/Handle/Text.hs index 1e41a7b..949231b 100644 --- a/GHC/IO/Handle/Text.hs +++ b/GHC/IO/Handle/Text.hs @@ -39,6 +39,7 @@ import qualified GHC.IO.Device as RawIO import Foreign import Foreign.C +import qualified Control.Exception as Exception import Data.Typeable import System.IO.Error import Data.Maybe @@ -240,12 +241,12 @@ hGetLineBufferedLoop handle_@Handle__{..} maybeFillReadBuffer :: Handle__ -> CharBuffer -> IO (Maybe CharBuffer) maybeFillReadBuffer handle_ buf - = catch + = Exception.catch (do buf' <- getSomeCharacters handle_ buf return (Just buf') ) - (\e -> do if isEOFError e - then return Nothing + (\e -> do if isEOFError e + then return Nothing else ioError e) -- See GHC.IO.Buffer @@ -370,8 +371,8 @@ lazyRead handle = lazyReadBuffered :: Handle -> Handle__ -> IO (Handle__, [Char]) lazyReadBuffered h handle_@Handle__{..} = do buf <- readIORef haCharBuffer - catch - (do + Exception.catch + (do buf'@Buffer{..} <- getSomeCharacters handle_ buf lazy_rest <- lazyRead h (s,r) <- if haInputNL == CRLF