on master help sign in
Fix documentation for array modules
commitc2f79142411383e14d8c7db0f2456775549925f0 authorHarendra Kumar <harendra@composewell.com> dateTue 3 Jan 2023, 12:01 (4 years ago) parent0c25ce6
5 files changed+13−11
core/src/Streamly/Data/Array.hs+2−4 core/src/Streamly/Data/Array/Generic.hs+5−1 core/src/Streamly/Data/Array/Generic/Mut.hs+1−1 core/src/Streamly/Data/Array/Mut.hs+4−2 core/src/Streamly/Internal/Data/Array/Type.hs+1−3
core/src/Streamly/Data/Array.hs+2−4
@@ -8,8 +8,8 @@
88-- Portability : GHC
99--
1010-- This module provides APIs to create and use unboxed immutable arrays. Once
11−-- created their contents cannot be modified. Only types that are unboxable via
12−-- the 'Unbox' type class can be stored in these arrays.
11+-- created, their contents cannot be modified. Only types that are unboxable
12+-- via the 'Unbox' type class can be stored in these arrays.
1313--
1414-- = Folding Arrays
1515--
@@ -146,9 +146,7 @@ import Prelude hiding (read)
146146-- >>> import System.IO.Unsafe (unsafePerformIO)
147147-- >>> import qualified Streamly.Data.Array as Array
148148-- >>> import qualified Streamly.Data.Fold as Fold
149−-- >>> import qualified Streamly.Internal.Data.Fold as Fold (morphInner)
150149-- >>> import qualified Streamly.Data.Stream as Stream
151−-- >>> import qualified Streamly.Internal.Data.Stream as Stream (morphInner)
152150
153151-- | Same as 'reader'
154152--
core/src/Streamly/Data/Array/Generic.hs+5−1
@@ -7,6 +7,10 @@
77-- Stability : experimental
88-- Portability : GHC
99--
10+-- Unconstrained version of "Streamly.Data.Array" module.
11+--
12+-- See the "Streamly.Data.Array" module for documentation.
13+--
1014module Streamly.Data.Array.Generic
1115 ( Array
1216
@@ -28,7 +32,7 @@ module Streamly.Data.Array.Generic
2832 -- * Random Access
2933 , A.length
3034
31− -- * Folding Arrays
35+ -- -- * Folding Arrays
3236 -- , A.streamFold
3337 -- , A.fold
3438 )
core/src/Streamly/Data/Array/Generic/Mut.hs+1−1
@@ -6,7 +6,7 @@
66-- Stability : experimental
77-- Portability : GHC
88--
9−-- Mutable arrays for all types (unconstrained).
9+-- Mutable variant of the "Streamly.Data.Array.Generic" module.
1010--
1111module Streamly.Data.Array.Generic.Mut
1212(
core/src/Streamly/Data/Array/Mut.hs+4−2
@@ -14,8 +14,7 @@
1414module Streamly.Data.Array.Mut
1515 (
1616 -- * Types
17− Unbox (..)
18− , Array
17+ Array
1918
2019 -- * Construction
2120
@@ -56,6 +55,9 @@ module Streamly.Data.Array.Mut
5655
5756 -- * Size
5857 , length
58+
59+ -- * Unbox Type Class
60+ , Unbox (..)
5961 )
6062where
6163
core/src/Streamly/Internal/Data/Array/Type.hs+1−3
@@ -120,13 +120,11 @@ import Streamly.Internal.System.IO (unsafeInlineIO, defaultChunkSize)
120120
121121-- $arrayNotes
122122--
123−-- We can use an 'Unboxed' constraint in the Array type and the constraint can
123+-- We can use an 'Unbox' constraint in the Array type and the constraint can
124124-- be automatically provided to a function that pattern matches on the Array
125125-- type. However, it has huge performance cost, so we do not use it.
126126-- Investigate a GHC improvement possiblity.
127127--
128−-- XXX Rename the fields to better names.
129−--
130128data Array a =
131129#ifdef DEVBUILD
132130 Unbox a =>