mirror of
https://github.com/composewell/streamly.git
synced 2024-09-19 07:29:02 +03:00
Make minor change to array module docs
This commit is contained in:
parent
65c86d6d83
commit
ba0d42aec0
@ -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:
|
||||
|
@ -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
|
||||
(
|
||||
|
@ -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
|
||||
(
|
||||
|
Loading…
Reference in New Issue
Block a user