Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
BebeSparkelSparkel committed May 1, 2024
1 parent f50ebc2 commit a1d55cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
9 changes: 5 additions & 4 deletions src/Data/Text/IO.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{-# LANGUAGE BangPatterns, CPP, RecordWildCards, ScopedTypeVariables #-}
{-# LANGUAGE BangPatterns, RecordWildCards, ScopedTypeVariables #-}
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# OPTIONS_GHC -Wno-name-shadowing #-}
-- |
-- Module : Data.Text.IO
-- Copyright : (c) 2009, 2010 Bryan O'Sullivan,
Expand Down Expand Up @@ -55,10 +56,10 @@ import qualified Control.Exception as E
import Control.Monad (liftM2, when)
import Data.IORef (readIORef, writeIORef)
import qualified Data.Text as T
import Data.Text.Internal.Fusion (stream, unstream)
import Data.Text.Internal.Fusion (stream)
import Data.Text.Internal.Fusion.Types (Step(..), Stream(..))
import Data.Text.Internal.IO (hGetLineWith, readChunk)
import GHC.IO.Buffer (Buffer(..), BufferState(..), CharBufElem, CharBuffer,
import GHC.IO.Buffer (Buffer(..), BufferState(..), CharBuffer,
RawCharBuffer, emptyBuffer, isEmptyBuffer, newCharBuffer,
writeCharBuf)
import GHC.IO.Exception (IOException(ioe_type), IOErrorType(InappropriateType))
Expand Down Expand Up @@ -262,7 +263,7 @@ writeBlocksCRLF h buf0 n (Stream next0 s0 _len) = outer s0 n buf0

{-# INLINE writeBlocksRaw #-}
writeBlocksRaw :: Handle -> CharBuffer -> Int -> Stream Char -> IO (Int, CharBuffer)
writeBlocksRaw h buf0 n str@(Stream next0 s0 _len) = outer s0 n buf0
writeBlocksRaw h buf0 n (Stream next0 s0 _len) = outer s0 n buf0
where
outer s1 n buf@Buffer{bufRaw=raw, bufSize=len} = inner s1 n
where
Expand Down
10 changes: 3 additions & 7 deletions src/Data/Text/Lazy/IO.hs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{-# LANGUAGE BangPatterns, CPP, RecordWildCards #-}
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE Trustworthy #-}
{-# OPTIONS_GHC -Wno-name-shadowing #-}
-- |
-- Module : Data.Text.Lazy.IO
-- Copyright : (c) 2009, 2010 Bryan O'Sullivan,
Expand Down Expand Up @@ -63,9 +62,6 @@ import System.IO (BufferMode(..), hGetBuffering, hSetBuffering)
import System.IO.Error (isEOFError)
import System.IO.Unsafe (unsafeInterleaveIO)
import Data.Text.Internal.Fusion (stream)
import Data.Text.Internal.Fusion.Types (Stream(Stream), Step(Done))
import qualified Data.Text.Internal.Fusion.Types as F
import Unsafe.Coerce (unsafeCoerce)
import Data.Foldable (foldlM)
import Data.Functor (void)

Expand Down

0 comments on commit a1d55cd

Please sign in to comment.