Make minor change to array module docs

This commit is contained in:
Harendra Kumar 2023-03-06 13:28:11 +05:30
parent 65c86d6d83
commit ba0d42aec0
3 changed files with 18 additions and 7 deletions

View File

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

View File

@ -7,9 +7,12 @@
-- Stability : released
-- Portability : GHC
--
-- This module provides mutable arrays suitable for long lived data storage,
-- random access, and mutation.
-- Mutable version of "Streamly.Data.Array". Please refer to that module for
-- general documentation. The contents of mutable ararys can be modified
-- in-place.
--
-- See "Streamly.Data.MutArray.Generic" for mutable arrays that work for boxed
-- types i.e. not requiring the 'Unbox' constraint.
module Streamly.Data.MutArray
(

View File

@ -6,7 +6,9 @@
-- Stability : experimental
-- Portability : GHC
--
-- Mutable variant of the "Streamly.Data.Array.Generic" module.
-- Unconstrained version of "Streamly.Data.MutArray" module.
--
-- See the "Streamly.Data.MutArray" module for documentation.
--
module Streamly.Data.MutArray.Generic
(