@@ -44,6 +44,7 @@ import qualified Streamly.Memory.Array as A
44import qualified Streamly.Prelude as S
44import qualified Streamly.Prelude as S
45import qualified Streamly.Data.String as SS
45import qualified Streamly.Data.String as SS
46import qualified Streamly.Internal.Prelude as Internal
46import qualified Streamly.Internal.Prelude as Internal
47+import qualified Streamly.Internal.Memory.ArrayStream as AS
48#ifdef INSPECTION
49#ifdef INSPECTION
49import Foreign.Storable (Storable)
50import Foreign.Storable (Storable)
@@ -81,7 +82,7 @@ inspect $ 'countBytes `hasNoType` ''Step
81-- | Count the number of lines in a file.
82-- | Count the number of lines in a file.
82{-# INLINE countLines #-}
83{-# INLINE countLines #-}
83countLines :: Handle -> IO Int
84countLines :: Handle -> IO Int
84−countLines = S.length . A.splitOnSuffix 10 . FH.readArrays
85+countLines = S.length . AS.splitOnSuffix 10 . FH.readArrays
86#ifdef INSPECTION
87#ifdef INSPECTION
87inspect $ hasNoTypeClasses 'countLines
88inspect $ hasNoTypeClasses 'countLines
@@ -92,7 +93,7 @@ inspect $ 'countLines `hasNoType` ''Step
92-- | Count the number of lines in a file.
93-- | Count the number of lines in a file.
93{-# INLINE countWords #-}
94{-# INLINE countWords #-}
94countWords :: Handle -> IO Int
95countWords :: Handle -> IO Int
95−countWords = S.length . A.splitOn 32 . FH.readArrays
96+countWords = S.length . AS.splitOn 32 . FH.readArrays
97#ifdef INSPECTION
98#ifdef INSPECTION
98inspect $ hasNoTypeClasses 'countWords
99inspect $ hasNoTypeClasses 'countWords
@@ -141,7 +142,7 @@ linesUnlinesCopy :: Handle -> Handle -> IO ()
141linesUnlinesCopy inh outh =
142linesUnlinesCopy inh outh =
142 S.runFold (FH.writeArraysInChunksOf (1024*1024) outh)
143 S.runFold (FH.writeArraysInChunksOf (1024*1024) outh)
143 $ Internal.insertAfterEach (return $ A.fromList [10])
144 $ Internal.insertAfterEach (return $ A.fromList [10])
144− $ A.splitOnSuffix 10
145+ $ AS.splitOnSuffix 10
145 $ FH.readArraysOf (1024*1024) inh
146 $ FH.readArraysOf (1024*1024) inh
147#ifdef INSPECTION
148#ifdef INSPECTION
@@ -156,7 +157,7 @@ wordsUnwordsCopy inh outh =
156 S.runFold (FH.writeArraysInChunksOf (1024*1024) outh)
157 S.runFold (FH.writeArraysInChunksOf (1024*1024) outh)
157 $ S.intersperse (A.fromList [32])
158 $ S.intersperse (A.fromList [32])
158 -- XXX use a word splitting combinator
159 -- XXX use a word splitting combinator
159− $ A.splitOn 32
160+ $ AS.splitOn 32
160 $ FH.readArraysOf (1024*1024) inh
161 $ FH.readArraysOf (1024*1024) inh
162#ifdef INSPECTION
163#ifdef INSPECTION