on master help sign in
rename flatten to concat
9bf7415Harendra Kumar
src/Streamly/Data/String.hs+1−2
@@ -90,7 +90,6 @@ import Streamly.Memory.Array (Array)
90
90
91import qualified Streamly.Prelude as S
91import qualified Streamly.Prelude as S
92import qualified Streamly.Memory.Array as A
92import qualified Streamly.Memory.Array as A
93−import qualified Streamly.Memory.ArrayStream as AS
94import qualified Streamly.Streams.StreamD as D
93import qualified Streamly.Streams.StreamD as D
95
94
96-- type String = List Char
95-- type String = List Char
@@ -276,4 +275,4 @@ unlines = AS.unlinesBy '\n'
276-- > unwords . words /= id
275-- > unwords . words /= id
277{-# INLINE unwords #-}
276{-# INLINE unwords #-}
278unwords :: (MonadAsync m, IsStream t) => t m (Array Char) -> t m Char
277unwords :: (MonadAsync m, IsStream t) => t m (Array Char) -> t m Char
279−unwords = AS.flatten . (S.intersperse (A.fromList " "))
278+unwords = A.concat . (S.intersperse (A.fromList " "))
src/Streamly/FileSystem/FD.hs+6−8
@@ -136,10 +136,9 @@ import Prelude hiding (read)
136import qualified GHC.IO.FD as FD
136import qualified GHC.IO.FD as FD
137import qualified GHC.IO.Device as RawIO
137import qualified GHC.IO.Device as RawIO
138
138
139−import Streamly.Memory.Array.Types (Array(..))
139+import Streamly.Memory.Array.Types (Array(..), byteLength, defaultChunkSize)
140import Streamly.Streams.Serial (SerialT)
140import Streamly.Streams.Serial (SerialT)
141import Streamly.Streams.StreamK.Type (IsStream, mkStream)
141import Streamly.Streams.StreamK.Type (IsStream, mkStream)
142−import Streamly.Memory.Array.Types (byteLength, defaultChunkSize)
143
142
144#if !defined(mingw32_HOST_OS)
143#if !defined(mingw32_HOST_OS)
145import Streamly.Memory.Array.Types (groupIOVecsOf)
144import Streamly.Memory.Array.Types (groupIOVecsOf)
@@ -151,7 +150,6 @@ import qualified Streamly.FileSystem.FDIO as RawIO hiding (write)
151-- import Streamly.String (encodeUtf8, decodeUtf8, foldLines)
150-- import Streamly.String (encodeUtf8, decodeUtf8, foldLines)
152
151
153import qualified Streamly.Memory.Array as A
152import qualified Streamly.Memory.Array as A
154−import qualified Streamly.Memory.ArrayStream as AS
155import qualified Streamly.Prelude as S
153import qualified Streamly.Prelude as S
156import qualified Streamly.Streams.StreamD.Type as D
154import qualified Streamly.Streams.StreamD.Type as D
157
155
@@ -327,7 +325,7 @@ readArrays = readArraysOfUpto defaultChunkSize
327--
325--
328{-# INLINE readInChunksOf #-}
326{-# INLINE readInChunksOf #-}
329readInChunksOf :: (IsStream t, MonadIO m) => Int -> Handle -> t m Word8
327readInChunksOf :: (IsStream t, MonadIO m) => Int -> Handle -> t m Word8
330−readInChunksOf chunkSize h = AS.flatten $ readArraysOfUpto chunkSize h
328+readInChunksOf chunkSize h = A.concat $ readArraysOfUpto chunkSize h
331
329
332-- TODO
330-- TODO
333-- read :: (IsStream t, MonadIO m, Storable a) => Handle -> t m a
331-- read :: (IsStream t, MonadIO m, Storable a) => Handle -> t m a
@@ -339,7 +337,7 @@ readInChunksOf chunkSize h = AS.flatten $ readArraysOfUpto chunkSize h
339-- @since 0.7.0
337-- @since 0.7.0
340{-# INLINE read #-}
338{-# INLINE read #-}
341read :: (IsStream t, MonadIO m) => Handle -> t m Word8
339read :: (IsStream t, MonadIO m) => Handle -> t m Word8
342−read = AS.flatten . readArrays
340+read = A.concat . readArrays
343
341
344-------------------------------------------------------------------------------
342-------------------------------------------------------------------------------
345-- Writing
343-- Writing
@@ -361,7 +359,7 @@ writeArrays h m = S.mapM_ (liftIO . writeArray h) m
361{-# INLINE writeArraysPackedUpto #-}
359{-# INLINE writeArraysPackedUpto #-}
362writeArraysPackedUpto :: (MonadIO m, Storable a)
360writeArraysPackedUpto :: (MonadIO m, Storable a)
363 => Int -> Handle -> SerialT m (Array a) -> m ()
361 => Int -> Handle -> SerialT m (Array a) -> m ()
364−writeArraysPackedUpto n h xs = writeArrays h $ AS.compact n xs
362+writeArraysPackedUpto n h xs = writeArrays h $ A.compact n xs
365
363
366#if !defined(mingw32_HOST_OS)
364#if !defined(mingw32_HOST_OS)
367-- XXX this is incomplete
365-- XXX this is incomplete
@@ -401,7 +399,7 @@ _writevArraysPackedUpto n h xs =
401-- @since 0.7.0
399-- @since 0.7.0
402{-# INLINE writeInChunksOf #-}
400{-# INLINE writeInChunksOf #-}
403writeInChunksOf :: MonadIO m => Int -> Handle -> SerialT m Word8 -> m ()
401writeInChunksOf :: MonadIO m => Int -> Handle -> SerialT m Word8 -> m ()
404−writeInChunksOf n h m = writeArrays h $ AS.arraysOf n m
402+writeInChunksOf n h m = writeArrays h $ A.arraysOf n m
405
403
406-- > write = 'writeInChunksOf' A.defaultChunkSize
404-- > write = 'writeInChunksOf' A.defaultChunkSize
407--
405--
@@ -534,7 +532,7 @@ readSliceWith chunkSize h pos len = undefined
534{-# INLINE readSlice #-}
532{-# INLINE readSlice #-}
535readSlice :: (IsStream t, MonadIO m, Storable a)
533readSlice :: (IsStream t, MonadIO m, Storable a)
536 => Handle -> Int -> Int -> t m a
534 => Handle -> Int -> Int -> t m a
537−readSlice = readSliceWith A.defaultChunkSize
535+readSlice = readSliceWith defaultChunkSize
538
536
539-- | @readSliceRev h i count@ streams a slice from the file handle @h@ starting
537-- | @readSliceRev h i count@ streams a slice from the file handle @h@ starting
540-- at index @i@ and reading up to @count@ elements in the reverse direction
538-- at index @i@ and reading up to @count@ elements in the reverse direction
src/Streamly/FileSystem/File.hs+11−12
@@ -115,7 +115,7 @@ import Prelude hiding (read)
115
115
116import qualified System.IO as SIO
116import qualified System.IO as SIO
117
117
118−import Streamly.Memory.Array.Types (Array(..))
118+import Streamly.Memory.Array.Types (Array(..), defaultChunkSize)
119import Streamly.Streams.Serial (SerialT)
119import Streamly.Streams.Serial (SerialT)
120import Streamly.Streams.StreamK.Type (IsStream)
120import Streamly.Streams.StreamK.Type (IsStream)
121import Streamly.SVar (MonadAsync)
121import Streamly.SVar (MonadAsync)
@@ -123,8 +123,7 @@ import Streamly.SVar (MonadAsync)
123-- import Streamly.String (encodeUtf8, decodeUtf8, foldLines)
123-- import Streamly.String (encodeUtf8, decodeUtf8, foldLines)
124
124
125import qualified Streamly.FileSystem.Handle as FH
125import qualified Streamly.FileSystem.Handle as FH
126−import qualified Streamly.Memory.ArrayStream as AS
126+import qualified Streamly.Memory.Array as A
127−import qualified Streamly.Memory.Array.Types as A hiding (flattenArrays)
128import qualified Streamly.Prelude as S
127import qualified Streamly.Prelude as S
129
128
130-------------------------------------------------------------------------------
129-------------------------------------------------------------------------------
@@ -203,7 +202,7 @@ readArraysOf size file = withFile file ReadMode (FH.readArraysOf size)
203{-# INLINE readArrays #-}
202{-# INLINE readArrays #-}
204readArrays :: (IsStream t, MonadCatch m, MonadIO m)
203readArrays :: (IsStream t, MonadCatch m, MonadIO m)
205 => FilePath -> t m (Array Word8)
204 => FilePath -> t m (Array Word8)
206−readArrays = readArraysOf A.defaultChunkSize
205+readArrays = readArraysOf defaultChunkSize
207
206
208-------------------------------------------------------------------------------
207-------------------------------------------------------------------------------
209-- Read File to Stream
208-- Read File to Stream
@@ -226,7 +225,7 @@ readInChunksOf chunkSize h = A.flattenArrays $ readArraysOf chunkSize h
226-- TODO
225-- TODO
227-- read :: (IsStream t, MonadIO m, Storable a) => Handle -> t m a
226-- read :: (IsStream t, MonadIO m, Storable a) => Handle -> t m a
228--
227--
229−-- > read = 'readByChunks' A.defaultChunkSize
228+-- > read = 'readByChunks' defaultChunkSize
230-- | Generate a stream of elements of the given type from a file specified by
229-- | Generate a stream of elements of the given type from a file specified by
231-- path. The stream ends when EOF is encountered. File is locked using multiple
230-- path. The stream ends when EOF is encountered. File is locked using multiple
232-- reader and single writer locking mode.
231-- reader and single writer locking mode.
@@ -234,7 +233,7 @@ readInChunksOf chunkSize h = A.flattenArrays $ readArraysOf chunkSize h
234-- @since 0.7.0
233-- @since 0.7.0
235{-# INLINE read #-}
234{-# INLINE read #-}
236read :: (IsStream t, MonadCatch m, MonadIO m) => FilePath -> t m Word8
235read :: (IsStream t, MonadCatch m, MonadIO m) => FilePath -> t m Word8
237−read file = AS.flatten $ withFile file ReadMode FH.readArrays
236+read file = A.concat $ withFile file ReadMode FH.readArrays
238
237
239{-
238{-
240-- | Generate a stream of elements of the given type from a file 'Handle'. The
239-- | Generate a stream of elements of the given type from a file 'Handle'. The
@@ -290,9 +289,9 @@ writeArrays = writeArraysMode WriteMode
290{-# INLINE writeInChunksOf #-}
289{-# INLINE writeInChunksOf #-}
291writeInChunksOf :: (MonadAsync m, MonadCatch m)
290writeInChunksOf :: (MonadAsync m, MonadCatch m)
292 => Int -> FilePath -> SerialT m Word8 -> m ()
291 => Int -> FilePath -> SerialT m Word8 -> m ()
293−writeInChunksOf n file xs = writeArrays file $ AS.arraysOf n xs
292+writeInChunksOf n file xs = writeArrays file $ A.arraysOf n xs
294
293
295−-- > write = 'writeInChunksOf' A.defaultChunkSize
294+-- > write = 'writeInChunksOf' defaultChunkSize
296--
295--
297-- | Write a byte stream to a file. Combines the bytes in chunks of size
296-- | Write a byte stream to a file. Combines the bytes in chunks of size
298-- up to 'A.defaultChunkSize' before writing. If the file exists it is
297-- up to 'A.defaultChunkSize' before writing. If the file exists it is
@@ -302,7 +301,7 @@ writeInChunksOf n file xs = writeArrays file $ AS.arraysOf n xs
302-- @since 0.7.0
301-- @since 0.7.0
303{-# INLINE write #-}
302{-# INLINE write #-}
304write :: (MonadAsync m, MonadCatch m) => FilePath -> SerialT m Word8 -> m ()
303write :: (MonadAsync m, MonadCatch m) => FilePath -> SerialT m Word8 -> m ()
305−write = writeInChunksOf A.defaultChunkSize
304+write = writeInChunksOf defaultChunkSize
306
305
307{-
306{-
308{-# INLINE write #-}
307{-# INLINE write #-}
@@ -326,7 +325,7 @@ appendArrays = writeArraysMode AppendMode
326{-# INLINE appendByChunks #-}
325{-# INLINE appendByChunks #-}
327appendByChunks :: (MonadAsync m, MonadCatch m)
326appendByChunks :: (MonadAsync m, MonadCatch m)
328 => Int -> FilePath -> SerialT m Word8 -> m ()
327 => Int -> FilePath -> SerialT m Word8 -> m ()
329−appendByChunks n file xs = appendArrays file $ AS.arraysOf n xs
328+appendByChunks n file xs = appendArrays file $ A.arraysOf n xs
330
329
331-- | Append a byte stream to a file. Combines the bytes in chunks of size up to
330-- | Append a byte stream to a file. Combines the bytes in chunks of size up to
332-- 'A.defaultChunkSize' before writing. If the file exists then the new data
331-- 'A.defaultChunkSize' before writing. If the file exists then the new data
@@ -336,7 +335,7 @@ appendByChunks n file xs = appendArrays file $ AS.arraysOf n xs
336-- @since 0.7.0
335-- @since 0.7.0
337{-# INLINE append #-}
336{-# INLINE append #-}
338append :: (MonadAsync m, MonadCatch m) => FilePath -> SerialT m Word8 -> m ()
337append :: (MonadAsync m, MonadCatch m) => FilePath -> SerialT m Word8 -> m ()
339−append = appendByChunks A.defaultChunkSize
338+append = appendByChunks defaultChunkSize
340
339
341{-
340{-
342-- | Like 'append' but the file is not locked for exclusive writes.
341-- | Like 'append' but the file is not locked for exclusive writes.
@@ -461,7 +460,7 @@ readSliceWith chunkSize h pos len = undefined
461{-# INLINE readSlice #-}
460{-# INLINE readSlice #-}
462readSlice :: (IsStream t, MonadIO m, Storable a)
461readSlice :: (IsStream t, MonadIO m, Storable a)
463 => Handle -> Int -> Int -> t m a
462 => Handle -> Int -> Int -> t m a
464−readSlice = readSliceWith A.defaultChunkSize
463+readSlice = readSliceWith defaultChunkSize
465
464
466-- | @readSliceRev h i count@ streams a slice from the file handle @h@ starting
465-- | @readSliceRev h i count@ streams a slice from the file handle @h@ starting
467-- at index @i@ and reading up to @count@ elements in the reverse direction
466-- at index @i@ and reading up to @count@ elements in the reverse direction
src/Streamly/FileSystem/Handle.hs+2−3
@@ -129,7 +129,6 @@ import Streamly.Fold (Fold)
129import qualified Streamly.Fold as FL
129import qualified Streamly.Fold as FL
130import qualified Streamly.Fold.Types as FL
130import qualified Streamly.Fold.Types as FL
131import qualified Streamly.Memory.Array as A
131import qualified Streamly.Memory.Array as A
132−import qualified Streamly.Memory.ArrayStream as AS
133import qualified Streamly.Streams.StreamD.Type as D
132import qualified Streamly.Streams.StreamD.Type as D
134
133
135-------------------------------------------------------------------------------
134-------------------------------------------------------------------------------
@@ -232,7 +231,7 @@ readArrays = readArraysOf defaultChunkSize
232-- @since 0.7.0
231-- @since 0.7.0
233{-# INLINE readInChunksOf #-}
232{-# INLINE readInChunksOf #-}
234readInChunksOf :: (IsStream t, MonadIO m) => Int -> Handle -> t m Word8
233readInChunksOf :: (IsStream t, MonadIO m) => Int -> Handle -> t m Word8
235−readInChunksOf chunkSize h = AS.flatten $ readArraysOf chunkSize h
234+readInChunksOf chunkSize h = A.concat $ readArraysOf chunkSize h
236
235
237-- TODO
236-- TODO
238-- Generate a stream of elements of the given type from a file 'Handle'.
237-- Generate a stream of elements of the given type from a file 'Handle'.
@@ -244,7 +243,7 @@ readInChunksOf chunkSize h = AS.flatten $ readArraysOf chunkSize h
244-- @since 0.7.0
243-- @since 0.7.0
245{-# INLINE read #-}
244{-# INLINE read #-}
246read :: (IsStream t, MonadIO m) => Handle -> t m Word8
245read :: (IsStream t, MonadIO m) => Handle -> t m Word8
247−read = AS.flatten . readArrays
246+read = A.concat . readArrays
248
247
249-------------------------------------------------------------------------------
248-------------------------------------------------------------------------------
250-- Writing
249-- Writing
src/Streamly/Memory/Array.hs+2−2
@@ -125,7 +125,7 @@ module Streamly.Memory.Array
125 , AS.arraysOf
125 , AS.arraysOf
126
126
127 -- ** Elimination
127 -- ** Elimination
128− , AS.flatten
128+ , AS.concat
129 -- , AS.concatRev
129 -- , AS.concatRev
130 , AS.unlinesBy
130 , AS.unlinesBy
131 , AS.toArray
131 , AS.toArray
@@ -143,7 +143,7 @@ import Foreign.ForeignPtr (withForeignPtr)
143import Foreign.ForeignPtr.Unsafe (unsafeForeignPtrToPtr)
143import Foreign.ForeignPtr.Unsafe (unsafeForeignPtrToPtr)
144import Foreign.Ptr (minusPtr, plusPtr)
144import Foreign.Ptr (minusPtr, plusPtr)
145import Foreign.Storable (Storable(..))
145import Foreign.Storable (Storable(..))
146−import Prelude hiding (length, null, last, map, (!!), read)
146+import Prelude hiding (length, null, last, map, (!!), read, concat)
147
147
148import Streamly.Memory.Array.Types (Array(..), length)
148import Streamly.Memory.Array.Types (Array(..), length)
149import Streamly.Streams.Serial (SerialT)
149import Streamly.Streams.Serial (SerialT)
src/Streamly/Memory/ArrayStream.hs+10−10
@@ -24,8 +24,8 @@ module Streamly.Memory.ArrayStream
24 arraysOf
24 arraysOf
25
25
26 -- * Flattening to elements
26 -- * Flattening to elements
27− , flatten
27+ , concat
28− -- , _flattenArraysRev
28+ , concatRev
29 , unlinesBy
29 , unlinesBy
30
30
31 -- * Transformation
31 -- * Transformation
@@ -43,7 +43,7 @@ import Data.Word (Word8)
43import Foreign.ForeignPtr (withForeignPtr)
43import Foreign.ForeignPtr (withForeignPtr)
44import Foreign.Ptr (minusPtr, plusPtr, castPtr)
44import Foreign.Ptr (minusPtr, plusPtr, castPtr)
45import Foreign.Storable (Storable(..))
45import Foreign.Storable (Storable(..))
46−import Prelude hiding (length, null, last, map, (!!), read)
46+import Prelude hiding (length, null, last, map, (!!), read, concat)
47
47
48import Streamly.Memory.Array.Types (Array(..), length)
48import Streamly.Memory.Array.Types (Array(..), length)
49import Streamly.Streams.Serial (SerialT)
49import Streamly.Streams.Serial (SerialT)
@@ -62,12 +62,12 @@ import qualified Streamly.Streams.Prelude as P
62--
62--
63-- Same as the following but more efficient:
63-- Same as the following but more efficient:
64--
64--
65−-- > flatten = S.concatMap A.read
65+-- > concat = S.concatMap A.read
66--
66--
67-- @since 0.7.0
67-- @since 0.7.0
68−{-# INLINE flatten #-}
68+{-# INLINE concat #-}
69−flatten :: (IsStream t, MonadIO m, Storable a) => t m (Array a) -> t m a
69+concat :: (IsStream t, MonadIO m, Storable a) => t m (Array a) -> t m a
70−flatten m = D.fromStreamD $ A.flattenArrays (D.toStreamD m)
70+concat m = D.fromStreamD $ A.flattenArrays (D.toStreamD m)
71
71
72-- XXX should we have a reverseArrays API to reverse the stream of arrays
72-- XXX should we have a reverseArrays API to reverse the stream of arrays
73-- instead?
73-- instead?
@@ -76,9 +76,9 @@ flatten m = D.fromStreamD $ A.flattenArrays (D.toStreamD m)
76-- contents of each array before flattening.
76-- contents of each array before flattening.
77--
77--
78-- @since 0.7.0
78-- @since 0.7.0
79−{-# INLINE _flattenArraysRev #-}
79+{-# INLINE concatRev #-}
80−_flattenArraysRev :: (IsStream t, MonadIO m, Storable a) => t m (Array a) -> t m a
80+concatRev :: (IsStream t, MonadIO m, Storable a) => t m (Array a) -> t m a
81−_flattenArraysRev m = D.fromStreamD $ A.flattenArraysRev (D.toStreamD m)
81+concatRev m = D.fromStreamD $ A.flattenArraysRev (D.toStreamD m)
82
82
83-- XXX use an Array instead as separator? Or use a separate unlinesArraysBySeq
83-- XXX use an Array instead as separator? Or use a separate unlinesArraysBySeq
84-- API for that?
84-- API for that?
src/Streamly/Network/Client.hs+1−2
@@ -73,7 +73,6 @@ import Streamly.Streams.StreamK.Type (IsStream)
73
73
74import qualified Streamly.Fold.Types as FL
74import qualified Streamly.Fold.Types as FL
75import qualified Streamly.Memory.Array as A
75import qualified Streamly.Memory.Array as A
76−import qualified Streamly.Memory.ArrayStream as AS
77import qualified Streamly.Prelude as S
76import qualified Streamly.Prelude as S
78import qualified Streamly.Network.Socket as SK
77import qualified Streamly.Network.Socket as SK
79
78
@@ -111,7 +110,7 @@ withConnection addr port =
111{-# INLINE read #-}
110{-# INLINE read #-}
112read :: (IsStream t, MonadCatch m, MonadIO m)
111read :: (IsStream t, MonadCatch m, MonadIO m)
113 => (Word8, Word8, Word8, Word8) -> PortNumber -> t m Word8
112 => (Word8, Word8, Word8, Word8) -> PortNumber -> t m Word8
114−read addr port = AS.flatten $ withConnection addr port SK.readArrays
113+read addr port = A.concat $ withConnection addr port SK.readArrays
115
114
116-------------------------------------------------------------------------------
115-------------------------------------------------------------------------------
117-- Writing
116-- Writing
src/Streamly/Network/Socket.hs+3−4
@@ -95,8 +95,7 @@ import Streamly.Fold (Fold)
95import qualified Streamly.Fold as FL
95import qualified Streamly.Fold as FL
96import qualified Streamly.Fold.Types as FL
96import qualified Streamly.Fold.Types as FL
97import qualified Streamly.Memory.Array as A
97import qualified Streamly.Memory.Array as A
98−import qualified Streamly.Memory.ArrayStream as AS
98+import qualified Streamly.Memory.Array.Types as A
99−import qualified Streamly.Memory.Array.Types as A hiding (flattenArrays)
100import qualified Streamly.Prelude as S
99import qualified Streamly.Prelude as S
101
100
102-- | @'withSocket' socket act@ runs the monadic computation @act@ passing the
101-- | @'withSocket' socket act@ runs the monadic computation @act@ passing the
@@ -266,7 +265,7 @@ readInChunksOf chunkSize h = A.flattenArrays $ readArraysUpto chunkSize h
266-- @since 0.7.0
265-- @since 0.7.0
267{-# INLINE read #-}
266{-# INLINE read #-}
268read :: (IsStream t, MonadIO m) => Socket -> t m Word8
267read :: (IsStream t, MonadIO m) => Socket -> t m Word8
269−read = AS.flatten . readArrays
268+read = A.concat . readArrays
270
269
271-------------------------------------------------------------------------------
270-------------------------------------------------------------------------------
272-- Writing
271-- Writing
@@ -302,7 +301,7 @@ writeArrays h = FL.drainBy (liftIO . writeArray h)
302-- @since 0.7.0
301-- @since 0.7.0
303{-# INLINE writeInChunksOfS #-}
302{-# INLINE writeInChunksOfS #-}
304writeInChunksOfS :: MonadIO m => Int -> Socket -> SerialT m Word8 -> m ()
303writeInChunksOfS :: MonadIO m => Int -> Socket -> SerialT m Word8 -> m ()
305−writeInChunksOfS n h m = writeArraysS h $ AS.arraysOf n m
304+writeInChunksOfS n h m = writeArraysS h $ A.arraysOf n m
306
305
307-- | Write a byte stream to a socket. Accumulates the input in chunks of
306-- | Write a byte stream to a socket. Accumulates the input in chunks of
308-- specified number of bytes before writing.
307-- specified number of bytes before writing.
test/Arrays.hs+2−2
@@ -84,7 +84,7 @@ testFlattenArrays =
84 forAll (vectorOf len (arbitrary :: Gen Int)) $ \list ->
84 forAll (vectorOf len (arbitrary :: Gen Int)) $ \list ->
85 monadicIO $ do
85 monadicIO $ do
86 xs <- S.toList
86 xs <- S.toList
87− $ A.flatten
87+ $ A.concat
88 $ A.arraysOf 240
88 $ A.arraysOf 240
89 $ S.fromList list
89 $ S.fromList list
90 assert (xs == list)
90 assert (xs == list)
@@ -109,5 +109,5 @@ main = hspec
109 prop "read . writeN n === id" $ testFromToStreamN
109 prop "read . writeN n === id" $ testFromToStreamN
110 prop "readRev . write === reverse" $ testToStreamRev
110 prop "readRev . write === reverse" $ testToStreamRev
111 prop "arraysOf concats to original" $ testArraysOf
111 prop "arraysOf concats to original" $ testArraysOf
112− prop "flattenArrays concats to original" $ testFlattenArrays
112+ prop "concats to original" $ testFlattenArrays
113 prop "read . write === id" $ testFromToStream
113 prop "read . write === id" $ testFromToStream