@@ -9,7 +9,13 @@
99--
1010-- This module provides APIs to create and use unboxed immutable arrays. Once
1111-- created, their contents cannot be modified. Only types that are unboxable
12−-- via the 'Unbox' type class can be stored in these arrays.
12+-- via the 'Unbox' type class can be stored in these arrays. Note that the
13+-- array memory grows automatically when creating a new array, therefore, an
14+-- array can be created from a variable length stream.
15+--
16+-- See "Streamly.Data.Array.Generic" for arrays that work for boxed types i.e.
17+-- not requiring the 'Unbox' constraint.
18+-- See "Streamly.Data.MutArray" for arrays that can be mutated in-place..
1319--
1420-- = Folding Arrays
1521--
@@ -55,6 +61,9 @@
5561-- >>> Stream.fold (purely Array.write) $ Stream.fromList [1,2,3::Int]
5662-- Identity fromList [1,2,3]
5763--
64+-- Since it is a pure stream we can use 'unsafePerformIO' to extract the result
65+-- of fold from IO.
66+--
5867-- Alternatively, 'Identity' streams can be generalized to IO streams:
5968--
6069-- >>> pure = Stream.fromList [1,2,3] :: Stream Identity Int
@@ -62,9 +71,6 @@
6271-- >>> Stream.fold Array.write (generally pure :: Stream IO Int)
6372-- fromList [1,2,3]
6473--
65−-- Since it is a pure stream we can use 'unsafePerformIO' to extract the result
66−-- of fold from IO.
67−--
6874-- = Programming Tips
6975--
7076-- This module is designed to be imported qualified: