@@ -59,7 +59,7 @@ import Test.Inspection
5959{-# INLINE last #-}
6060last :: Handle -> IO (Maybe Word8)
6161last inh = do
62− let s = IFH.readArrays inh
62+ let s = IFH.toStreamArrays inh
6363 larr <- S.last s
6464 return $ case larr of
6565 Nothing -> Nothing
@@ -74,7 +74,7 @@ inspect $ 'last `hasNoType` ''Step
7474{-# INLINE countBytes #-}
7575countBytes :: Handle -> IO Int
7676countBytes inh =
77− let s = IFH.readArrays inh
77+ let s = IFH.toStreamArrays inh
7878 in S.sum (S.map A.length s)
7979
8080#ifdef INSPECTION
@@ -85,7 +85,7 @@ inspect $ 'countBytes `hasNoType` ''Step
8585-- | Count the number of lines in a file.
8686{-# INLINE countLines #-}
8787countLines :: Handle -> IO Int
88−countLines = S.length . AS.splitOnSuffix 10 . IFH.readArrays
88+countLines = S.length . AS.splitOnSuffix 10 . IFH.toStreamArrays
8989
9090#ifdef INSPECTION
9191inspect $ hasNoTypeClasses 'countLines
@@ -96,7 +96,7 @@ inspect $ 'countLines `hasNoType` ''Step
9696-- | Count the number of lines in a file.
9797{-# INLINE countWords #-}
9898countWords :: Handle -> IO Int
99−countWords = S.length . AS.splitOn 32 . IFH.readArrays
99+countWords = S.length . AS.splitOn 32 . IFH.toStreamArrays
100100
101101#ifdef INSPECTION
102102inspect $ hasNoTypeClasses 'countWords
@@ -108,7 +108,7 @@ inspect $ 'countWords `hasNoType` ''Step
108108sumBytes :: Handle -> IO Word8
109109sumBytes inh = do
110110 let foldlArr' f z = runIdentity . S.foldl' f z . IA.toStream
111− let s = IFH.readArrays inh
111+ let s = IFH.toStreamArrays inh
112112 S.foldl' (\acc arr -> acc + foldlArr' (+) 0 arr) 0 s
113113
114114#ifdef INSPECTION
@@ -120,7 +120,7 @@ inspect $ 'sumBytes `hasNoType` ''Step
120120{-# INLINE cat #-}
121121cat :: Handle -> Handle -> IO ()
122122cat devNull inh =
123− S.fold (IFH.writeArrays devNull) $ IFH.readArraysOf (256*1024) inh
123+ S.fold (IFH.writeArrays devNull) $ IFH.toStreamArraysOf (256*1024) inh
124124
125125#ifdef INSPECTION
126126inspect $ hasNoTypeClasses 'cat
@@ -131,7 +131,7 @@ inspect $ 'cat `hasNoType` ''Step
131131{-# INLINE copy #-}
132132copy :: Handle -> Handle -> IO ()
133133copy inh outh =
134− let s = IFH.readArrays inh
134+ let s = IFH.toStreamArrays inh
135135 in S.fold (IFH.writeArrays outh) s
136136
137137#ifdef INSPECTION
@@ -146,7 +146,7 @@ linesUnlinesCopy inh outh =
146146 S.fold (IFH.writeArraysInChunksOf (1024*1024) outh)
147147 $ Internal.insertAfterEach (return $ A.fromList [10])
148148 $ AS.splitOnSuffix 10
149− $ IFH.readArraysOf (1024*1024) inh
149+ $ IFH.toStreamArraysOf (1024*1024) inh
150150
151151#ifdef INSPECTION
152152inspect $ hasNoTypeClassesExcept 'linesUnlinesCopy [''Storable]
@@ -161,7 +161,7 @@ wordsUnwordsCopy inh outh =
161161 $ S.intersperse (A.fromList [32])
162162 -- XXX use a word splitting combinator
163163 $ AS.splitOn 32
164− $ IFH.readArraysOf (1024*1024) inh
164+ $ IFH.toStreamArraysOf (1024*1024) inh
165165
166166#ifdef INSPECTION
167167inspect $ hasNoTypeClassesExcept 'wordsUnwordsCopy [''Storable]
@@ -173,7 +173,7 @@ decodeUtf8Lenient :: Handle -> IO ()
173173decodeUtf8Lenient inh =
174174 S.drain
175175 $ SS.decodeUtf8ArraysLenient
176− $ IFH.readArraysOf (1024*1024) inh
176+ $ IFH.toStreamArraysOf (1024*1024) inh
177177
178178#ifdef INSPECTION
179179inspect $ hasNoTypeClasses 'decodeUtf8Lenient
@@ -189,7 +189,7 @@ copyCodecUtf8Lenient inh outh =
189189 S.fold (FH.write outh)
190190 $ SS.encodeUtf8
191191 $ SS.decodeUtf8ArraysLenient
192− $ IFH.readArraysOf (1024*1024) inh
192+ $ IFH.toStreamArraysOf (1024*1024) inh
193193
194194#ifdef INSPECTION
195195inspect $ hasNoTypeClasses 'copyCodecUtf8Lenient