@@ -59,7 +59,7 @@ import Test.Inspection
59{-# INLINE last #-}
59{-# INLINE last #-}
60last :: Handle -> IO (Maybe Word8)
60last :: Handle -> IO (Maybe Word8)
61last inh = do
61last inh = do
62− let s = IFH.readArrays inh
62+ let s = IFH.toStreamArrays inh
63 larr <- S.last s
63 larr <- S.last s
64 return $ case larr of
64 return $ case larr of
65 Nothing -> Nothing
65 Nothing -> Nothing
@@ -74,7 +74,7 @@ inspect $ 'last `hasNoType` ''Step
74{-# INLINE countBytes #-}
74{-# INLINE countBytes #-}
75countBytes :: Handle -> IO Int
75countBytes :: Handle -> IO Int
76countBytes inh =
76countBytes inh =
77− let s = IFH.readArrays inh
77+ let s = IFH.toStreamArrays inh
78 in S.sum (S.map A.length s)
78 in S.sum (S.map A.length s)
80#ifdef INSPECTION
80#ifdef INSPECTION
@@ -85,7 +85,7 @@ inspect $ 'countBytes `hasNoType` ''Step
85-- | Count the number of lines in a file.
85-- | Count the number of lines in a file.
86{-# INLINE countLines #-}
86{-# INLINE countLines #-}
87countLines :: Handle -> IO Int
87countLines :: Handle -> IO Int
88−countLines = S.length . AS.splitOnSuffix 10 . IFH.readArrays
88+countLines = S.length . AS.splitOnSuffix 10 . IFH.toStreamArrays
90#ifdef INSPECTION
90#ifdef INSPECTION
91inspect $ hasNoTypeClasses 'countLines
91inspect $ hasNoTypeClasses 'countLines
@@ -96,7 +96,7 @@ inspect $ 'countLines `hasNoType` ''Step
96-- | Count the number of lines in a file.
96-- | Count the number of lines in a file.
97{-# INLINE countWords #-}
97{-# INLINE countWords #-}
98countWords :: Handle -> IO Int
98countWords :: Handle -> IO Int
99−countWords = S.length . AS.splitOn 32 . IFH.readArrays
99+countWords = S.length . AS.splitOn 32 . IFH.toStreamArrays
101#ifdef INSPECTION
101#ifdef INSPECTION
102inspect $ hasNoTypeClasses 'countWords
102inspect $ hasNoTypeClasses 'countWords
@@ -108,7 +108,7 @@ inspect $ 'countWords `hasNoType` ''Step
108sumBytes :: Handle -> IO Word8
108sumBytes :: Handle -> IO Word8
109sumBytes inh = do
109sumBytes inh = do
110 let foldlArr' f z = runIdentity . S.foldl' f z . IA.toStream
110 let foldlArr' f z = runIdentity . S.foldl' f z . IA.toStream
111− let s = IFH.readArrays inh
111+ let s = IFH.toStreamArrays inh
112 S.foldl' (\acc arr -> acc + foldlArr' (+) 0 arr) 0 s
112 S.foldl' (\acc arr -> acc + foldlArr' (+) 0 arr) 0 s
114#ifdef INSPECTION
114#ifdef INSPECTION
@@ -120,7 +120,7 @@ inspect $ 'sumBytes `hasNoType` ''Step
120{-# INLINE cat #-}
120{-# INLINE cat #-}
121cat :: Handle -> Handle -> IO ()
121cat :: Handle -> Handle -> IO ()
122cat devNull inh =
122cat devNull inh =
123− S.fold (IFH.writeArrays devNull) $ IFH.readArraysOf (256*1024) inh
123+ S.fold (IFH.writeArrays devNull) $ IFH.toStreamArraysOf (256*1024) inh
125#ifdef INSPECTION
125#ifdef INSPECTION
126inspect $ hasNoTypeClasses 'cat
126inspect $ hasNoTypeClasses 'cat
@@ -131,7 +131,7 @@ inspect $ 'cat `hasNoType` ''Step
131{-# INLINE copy #-}
131{-# INLINE copy #-}
132copy :: Handle -> Handle -> IO ()
132copy :: Handle -> Handle -> IO ()
133copy inh outh =
133copy inh outh =
134− let s = IFH.readArrays inh
134+ let s = IFH.toStreamArrays inh
135 in S.fold (IFH.writeArrays outh) s
135 in S.fold (IFH.writeArrays outh) s
137#ifdef INSPECTION
137#ifdef INSPECTION
@@ -146,7 +146,7 @@ linesUnlinesCopy inh outh =
146 S.fold (IFH.writeArraysInChunksOf (1024*1024) outh)
146 S.fold (IFH.writeArraysInChunksOf (1024*1024) outh)
147 $ Internal.insertAfterEach (return $ A.fromList [10])
147 $ Internal.insertAfterEach (return $ A.fromList [10])
148 $ AS.splitOnSuffix 10
148 $ AS.splitOnSuffix 10
149− $ IFH.readArraysOf (1024*1024) inh
149+ $ IFH.toStreamArraysOf (1024*1024) inh
151#ifdef INSPECTION
151#ifdef INSPECTION
152inspect $ hasNoTypeClassesExcept 'linesUnlinesCopy [''Storable]
152inspect $ hasNoTypeClassesExcept 'linesUnlinesCopy [''Storable]
@@ -161,7 +161,7 @@ wordsUnwordsCopy inh outh =
161 $ S.intersperse (A.fromList [32])
161 $ S.intersperse (A.fromList [32])
162 -- XXX use a word splitting combinator
162 -- XXX use a word splitting combinator
163 $ AS.splitOn 32
163 $ AS.splitOn 32
164− $ IFH.readArraysOf (1024*1024) inh
164+ $ IFH.toStreamArraysOf (1024*1024) inh
166#ifdef INSPECTION
166#ifdef INSPECTION
167inspect $ hasNoTypeClassesExcept 'wordsUnwordsCopy [''Storable]
167inspect $ hasNoTypeClassesExcept 'wordsUnwordsCopy [''Storable]
@@ -173,7 +173,7 @@ decodeUtf8Lenient :: Handle -> IO ()
173decodeUtf8Lenient inh =
173decodeUtf8Lenient inh =
175 $ SS.decodeUtf8ArraysLenient
175 $ SS.decodeUtf8ArraysLenient
176− $ IFH.readArraysOf (1024*1024) inh
176+ $ IFH.toStreamArraysOf (1024*1024) inh
178#ifdef INSPECTION
178#ifdef INSPECTION
179inspect $ hasNoTypeClasses 'decodeUtf8Lenient
179inspect $ hasNoTypeClasses 'decodeUtf8Lenient
@@ -189,7 +189,7 @@ copyCodecUtf8Lenient inh outh =
189 S.fold (FH.write outh)
189 S.fold (FH.write outh)
190 $ SS.encodeUtf8
190 $ SS.encodeUtf8
191 $ SS.decodeUtf8ArraysLenient
191 $ SS.decodeUtf8ArraysLenient
192− $ IFH.readArraysOf (1024*1024) inh
192+ $ IFH.toStreamArraysOf (1024*1024) inh
194#ifdef INSPECTION
194#ifdef INSPECTION
195inspect $ hasNoTypeClasses 'copyCodecUtf8Lenient
195inspect $ hasNoTypeClasses 'copyCodecUtf8Lenient