Skip to content

Commit

Permalink
Get rid of the final compilation warnings from 6.10.
Browse files Browse the repository at this point in the history
Also, use smart constructors out of paranoia.

--HG--
extra : convert_revision : b42471e675d6820b44228ca90cd6a7f505a9fd8d
  • Loading branch information
bos committed Dec 15, 2009
1 parent e2009c7 commit bbd5555
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Data/Text/Lazy/IO.hs
Expand Up @@ -31,21 +31,22 @@ module Data.Text.Lazy.IO
, putStrLn
) where

import Data.Text.Lazy.Internal (Text(..))
import Data.Text.Lazy (Text)
import Prelude hiding (appendFile, getContents, getLine, interact, putStr,
putStrLn, readFile, writeFile)
import System.IO (Handle, IOMode(..), hPutChar, openFile, stdin, stdout,
withFile)
import qualified Data.Text.IO as T
import qualified Data.Text.Lazy as L
#if __GLASGOW_HASKELL__ <= 610
import Data.Text.Lazy.Encoding (decodeUtf8, encodeUtf8)
import Data.Text.Lazy.Encoding (decodeUtf8)
import qualified Data.ByteString.Char8 as S8
import qualified Data.ByteString.Lazy.Char8 as L8
#else
import Control.Exception (throw)
import Data.IORef (readIORef)
import Data.Text.IO.Internal (hGetLineWith, readChunk)
import Data.Text.Lazy.Internal (chunk, empty)
import GHC.IO.Buffer (isEmptyBuffer)
import GHC.IO.Exception (IOException(..), IOErrorType(..), ioException)
import GHC.IO.Handle.Internals (augmentIOError, hClose_help,
Expand Down Expand Up @@ -94,11 +95,11 @@ lazyReadBuffered h hh@Handle__{..} = do
buf <- readIORef haCharBuffer
(do t <- readChunk hh buf
ts <- lazyRead h
return (hh, Chunk t ts)) `catch` \e -> do
return (hh, chunk t ts)) `catch` \e -> do
(hh', _) <- hClose_help hh
if isEOFError e
then return $ if isEmptyBuffer buf
then (hh', Empty)
then (hh', empty)
else (hh', L.singleton '\r')
else throw (augmentIOError e "hGetContents" h)
#endif
Expand Down

0 comments on commit bbd5555

Please sign in to comment.