on master help sign in
Fix documentation for array modules
c2f7914Harendra Kumar
core/src/Streamly/Data/Array.hs+2−4
@@ -8,8 +8,8 @@
8-- Portability : GHC
8-- Portability : GHC
9--
9--
10-- This module provides APIs to create and use unboxed immutable arrays. Once
10-- 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
11+-- created, their contents cannot be modified. Only types that are unboxable
12−-- the 'Unbox' type class can be stored in these arrays.
12+-- via the 'Unbox' type class can be stored in these arrays.
13--
13--
14-- = Folding Arrays
14-- = Folding Arrays
15--
15--
@@ -146,9 +146,7 @@ import Prelude hiding (read)
146-- >>> import System.IO.Unsafe (unsafePerformIO)
146-- >>> import System.IO.Unsafe (unsafePerformIO)
147-- >>> import qualified Streamly.Data.Array as Array
147-- >>> import qualified Streamly.Data.Array as Array
148-- >>> import qualified Streamly.Data.Fold as Fold
148-- >>> import qualified Streamly.Data.Fold as Fold
149−-- >>> import qualified Streamly.Internal.Data.Fold as Fold (morphInner)
150-- >>> import qualified Streamly.Data.Stream as Stream
149-- >>> import qualified Streamly.Data.Stream as Stream
151−-- >>> import qualified Streamly.Internal.Data.Stream as Stream (morphInner)
152
150
153-- | Same as 'reader'
151-- | Same as 'reader'
154--
152--
core/src/Streamly/Data/Array/Generic.hs+5−1
@@ -7,6 +7,10 @@
7-- Stability : experimental
7-- Stability : experimental
8-- Portability : GHC
8-- Portability : GHC
9--
9--
10+-- Unconstrained version of "Streamly.Data.Array" module.
11+--
12+-- See the "Streamly.Data.Array" module for documentation.
13+--
10module Streamly.Data.Array.Generic
14module Streamly.Data.Array.Generic
11 ( Array
15 ( Array
12
16
@@ -28,7 +32,7 @@ module Streamly.Data.Array.Generic
28 -- * Random Access
32 -- * Random Access
29 , A.length
33 , A.length
30
34
31− -- * Folding Arrays
35+ -- -- * Folding Arrays
32 -- , A.streamFold
36 -- , A.streamFold
33 -- , A.fold
37 -- , A.fold
34 )
38 )
core/src/Streamly/Data/Array/Generic/Mut.hs+1−1
@@ -6,7 +6,7 @@
6-- Stability : experimental
6-- Stability : experimental
7-- Portability : GHC
7-- Portability : GHC
8--
8--
9−-- Mutable arrays for all types (unconstrained).
9+-- Mutable variant of the "Streamly.Data.Array.Generic" module.
10--
10--
11module Streamly.Data.Array.Generic.Mut
11module Streamly.Data.Array.Generic.Mut
12(
12(
core/src/Streamly/Data/Array/Mut.hs+4−2
@@ -14,8 +14,7 @@
14module Streamly.Data.Array.Mut
14module Streamly.Data.Array.Mut
15 (
15 (
16 -- * Types
16 -- * Types
17− Unbox (..)
18− , Array
17+ Array
19
18
20 -- * Construction
19 -- * Construction
21
20
@@ -56,6 +55,9 @@ module Streamly.Data.Array.Mut
56
55
57 -- * Size
56 -- * Size
58 , length
57 , length
58+
59+ -- * Unbox Type Class
60+ , Unbox (..)
59 )
61 )
60where
62where
61
63
core/src/Streamly/Internal/Data/Array/Type.hs+1−3
@@ -120,13 +120,11 @@ import Streamly.Internal.System.IO (unsafeInlineIO, defaultChunkSize)
120
120
121-- $arrayNotes
121-- $arrayNotes
122--
122--
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
124-- be automatically provided to a function that pattern matches on the Array
124-- be automatically provided to a function that pattern matches on the Array
125-- type. However, it has huge performance cost, so we do not use it.
125-- type. However, it has huge performance cost, so we do not use it.
126-- Investigate a GHC improvement possiblity.
126-- Investigate a GHC improvement possiblity.
127--
127--
128−-- XXX Rename the fields to better names.
129−--
130data Array a =
128data Array a =
131#ifdef DEVBUILD
129#ifdef DEVBUILD
132 Unbox a =>
130 Unbox a =>