on master help sign in
Cleanup and make consistent the export lists of Array modules
1184527Harendra Kumar
benchmark/Streamly/Benchmark/FileSystem/Handle/Read.hs+7−8
@@ -33,7 +33,6 @@ import qualified Streamly.Data.Stream as Stream
33import qualified Streamly.Data.Fold as Fold
33import qualified Streamly.Data.Fold as Fold
34import qualified Streamly.FileSystem.Handle as FH
34import qualified Streamly.FileSystem.Handle as FH
35import qualified Streamly.Internal.Data.Array as A
35import qualified Streamly.Internal.Data.Array as A
36−import qualified Streamly.Internal.Data.Array as AT
37import qualified Streamly.Internal.Data.Fold as FL
36import qualified Streamly.Internal.Data.Fold as FL
38import qualified Streamly.Internal.Data.Stream as IP
37import qualified Streamly.Internal.Data.Stream as IP
39import qualified Streamly.Internal.FileSystem.Handle as IFH
38import qualified Streamly.Internal.FileSystem.Handle as IFH
@@ -48,7 +47,7 @@ import Streamly.Benchmark.Common.Handle
48#ifdef INSPECTION
47#ifdef INSPECTION
49import Streamly.Internal.Data.Stream (Step(..), FoldMany)
48import Streamly.Internal.Data.Stream (Step(..), FoldMany)
50
49
51−import qualified Streamly.Internal.Data.MutArray as MA
50+import qualified Streamly.Internal.Data.MutArray as MutArray
52import qualified Streamly.Internal.Data.Stream as D
51import qualified Streamly.Internal.Data.Stream as D
53import qualified Streamly.Internal.Data.Unfold as IUF
52import qualified Streamly.Internal.Data.Unfold as IUF
54
53
@@ -69,7 +68,7 @@ readLast = S.fold Fold.last . S.unfold FH.reader
69inspect $ hasNoTypeClasses 'readLast
68inspect $ hasNoTypeClasses 'readLast
70inspect $ 'readLast `hasNoType` ''Step -- S.unfold
69inspect $ 'readLast `hasNoType` ''Step -- S.unfold
71inspect $ 'readLast `hasNoType` ''IUF.ConcatState -- FH.read/UF.many
70inspect $ 'readLast `hasNoType` ''IUF.ConcatState -- FH.read/UF.many
72−inspect $ 'readLast `hasNoType` ''MA.ArrayUnsafe -- FH.read/A.read
71+inspect $ 'readLast `hasNoType` ''MutArray.ArrayUnsafe -- FH.read/A.read
73#endif
72#endif
74
73
75-- assert that flattenArrays constructors are not present
74-- assert that flattenArrays constructors are not present
@@ -81,7 +80,7 @@ readCountBytes = S.fold Fold.length . S.unfold FH.reader
81inspect $ hasNoTypeClasses 'readCountBytes
80inspect $ hasNoTypeClasses 'readCountBytes
82inspect $ 'readCountBytes `hasNoType` ''Step -- S.unfold
81inspect $ 'readCountBytes `hasNoType` ''Step -- S.unfold
83inspect $ 'readCountBytes `hasNoType` ''IUF.ConcatState -- FH.read/UF.many
82inspect $ 'readCountBytes `hasNoType` ''IUF.ConcatState -- FH.read/UF.many
84−inspect $ 'readCountBytes `hasNoType` ''MA.ArrayUnsafe -- FH.read/A.read
83+inspect $ 'readCountBytes `hasNoType` ''MutArray.ArrayUnsafe -- FH.read/A.read
85#endif
84#endif
86
85
87-- | Count the number of lines in a file.
86-- | Count the number of lines in a file.
@@ -96,7 +95,7 @@ readCountLines =
96inspect $ hasNoTypeClasses 'readCountLines
95inspect $ hasNoTypeClasses 'readCountLines
97inspect $ 'readCountLines `hasNoType` ''Step
96inspect $ 'readCountLines `hasNoType` ''Step
98inspect $ 'readCountLines `hasNoType` ''IUF.ConcatState -- FH.read/UF.many
97inspect $ 'readCountLines `hasNoType` ''IUF.ConcatState -- FH.read/UF.many
99−inspect $ 'readCountLines `hasNoType` ''MA.ArrayUnsafe -- FH.read/A.read
98+inspect $ 'readCountLines `hasNoType` ''MutArray.ArrayUnsafe -- FH.read/A.read
100#endif
99#endif
101
100
102-- | Count the number of words in a file.
101-- | Count the number of words in a file.
@@ -120,7 +119,7 @@ readSumBytes = S.fold Fold.sum . S.unfold FH.reader
120inspect $ hasNoTypeClasses 'readSumBytes
119inspect $ hasNoTypeClasses 'readSumBytes
121inspect $ 'readSumBytes `hasNoType` ''Step
120inspect $ 'readSumBytes `hasNoType` ''Step
122inspect $ 'readSumBytes `hasNoType` ''IUF.ConcatState -- FH.read/UF.many
121inspect $ 'readSumBytes `hasNoType` ''IUF.ConcatState -- FH.read/UF.many
123−inspect $ 'readSumBytes `hasNoType` ''MA.ArrayUnsafe -- FH.read/A.read
122+inspect $ 'readSumBytes `hasNoType` ''MutArray.ArrayUnsafe -- FH.read/A.read
124#endif
123#endif
125
124
126-- XXX When we mark this with INLINE and we have two benchmarks using S.drain
125-- XXX When we mark this with INLINE and we have two benchmarks using S.drain
@@ -236,13 +235,13 @@ groupsOf :: Int -> Handle -> IO Int
236groupsOf n inh =
235groupsOf n inh =
237 -- writeNUnsafe gives 2.5x boost here over writeN.
236 -- writeNUnsafe gives 2.5x boost here over writeN.
238 S.fold Fold.length
237 S.fold Fold.length
239− $ IP.groupsOf n (AT.writeNUnsafe n) (S.unfold FH.reader inh)
238+ $ IP.groupsOf n (A.writeNUnsafe n) (S.unfold FH.reader inh)
240
239
241#ifdef INSPECTION
240#ifdef INSPECTION
242inspect $ hasNoTypeClasses 'groupsOf
241inspect $ hasNoTypeClasses 'groupsOf
243inspect $ 'groupsOf `hasNoType` ''Step
242inspect $ 'groupsOf `hasNoType` ''Step
244inspect $ 'groupsOf `hasNoType` ''FoldMany
243inspect $ 'groupsOf `hasNoType` ''FoldMany
245−inspect $ 'groupsOf `hasNoType` ''AT.ArrayUnsafe -- AT.writeNUnsafe
244+inspect $ 'groupsOf `hasNoType` ''MutArray.ArrayUnsafe -- AT.writeNUnsafe
246 -- FH.read/A.read
245 -- FH.read/A.read
247inspect $ 'groupsOf `hasNoType` ''IUF.ConcatState -- FH.read/UF.many
246inspect $ 'groupsOf `hasNoType` ''IUF.ConcatState -- FH.read/UF.many
248#endif
247#endif
benchmark/Streamly/Benchmark/FileSystem/Handle/ReadWrite.hs+8−9
@@ -42,8 +42,7 @@ import Streamly.Internal.Data.Stream (Step(..))
42
42
43import qualified Streamly.Internal.Data.Stream as D
43import qualified Streamly.Internal.Data.Stream as D
44import qualified Streamly.Internal.Data.Tuple.Strict as Strict
44import qualified Streamly.Internal.Data.Tuple.Strict as Strict
45−import qualified Streamly.Internal.Data.MutArray.Stream as MAS
45+import qualified Streamly.Internal.Data.MutArray as MutArray
46−import qualified Streamly.Internal.Data.Array as AT
47
46
48import Test.Inspection
47import Test.Inspection
49#endif
48#endif
@@ -83,7 +82,7 @@ copyStream inh outh = S.fold (FH.write outh) (S.unfold FH.reader inh)
83inspect $ hasNoTypeClasses 'copyStream
82inspect $ hasNoTypeClasses 'copyStream
84inspect $ 'copyStream `hasNoType` ''Step -- S.unfold
83inspect $ 'copyStream `hasNoType` ''Step -- S.unfold
85inspect $ 'copyStream `hasNoType` ''IUF.ConcatState -- FH.read/UF.many
84inspect $ 'copyStream `hasNoType` ''IUF.ConcatState -- FH.read/UF.many
86−inspect $ 'copyStream `hasNoType` ''AT.ArrayUnsafe -- FH.write/writeNUnsafe
85+inspect $ 'copyStream `hasNoType` ''MutArray.ArrayUnsafe -- FH.write/writeNUnsafe
87 -- FH.read/A.read
86 -- FH.read/A.read
88inspect $ 'copyStream `hasNoType` ''Strict.Tuple3' -- FH.write/chunksOf
87inspect $ 'copyStream `hasNoType` ''Strict.Tuple3' -- FH.write/chunksOf
89#endif
88#endif
@@ -109,8 +108,8 @@ readFromBytesNull inh devNull = IFH.putBytes devNull $ S.unfold FH.reader inh
109#ifdef INSPECTION
108#ifdef INSPECTION
110inspect $ hasNoTypeClasses 'readFromBytesNull
109inspect $ hasNoTypeClasses 'readFromBytesNull
111inspect $ 'readFromBytesNull `hasNoType` ''Step
110inspect $ 'readFromBytesNull `hasNoType` ''Step
112−inspect $ 'readFromBytesNull `hasNoType` ''MAS.SpliceState
111+inspect $ 'readFromBytesNull `hasNoType` ''MutArray.SpliceState
113−inspect $ 'readFromBytesNull `hasNoType` ''AT.ArrayUnsafe -- FH.fromBytes/S.chunksOf
112+inspect $ 'readFromBytesNull `hasNoType` ''MutArray.ArrayUnsafe -- FH.fromBytes/S.chunksOf
114inspect $ 'readFromBytesNull `hasNoType` ''D.FoldMany
113inspect $ 'readFromBytesNull `hasNoType` ''D.FoldMany
115#endif
114#endif
116
115
@@ -123,8 +122,8 @@ readWithFromBytesNull inh devNull =
123#ifdef INSPECTION
122#ifdef INSPECTION
124inspect $ hasNoTypeClasses 'readWithFromBytesNull
123inspect $ hasNoTypeClasses 'readWithFromBytesNull
125inspect $ 'readWithFromBytesNull `hasNoType` ''Step
124inspect $ 'readWithFromBytesNull `hasNoType` ''Step
126−inspect $ 'readWithFromBytesNull `hasNoType` ''MAS.SpliceState
125+inspect $ 'readWithFromBytesNull `hasNoType` ''MutArray.SpliceState
127−inspect $ 'readWithFromBytesNull `hasNoType` ''AT.ArrayUnsafe -- FH.fromBytes/S.chunksOf
126+inspect $ 'readWithFromBytesNull `hasNoType` ''MutArray.ArrayUnsafe -- FH.fromBytes/S.chunksOf
128inspect $ 'readWithFromBytesNull `hasNoType` ''D.FoldMany
127inspect $ 'readWithFromBytesNull `hasNoType` ''D.FoldMany
129#endif
128#endif
130
129
@@ -171,7 +170,7 @@ writeReadWith inh devNull = IUF.fold fld unf (defaultChunkSize, inh)
171inspect $ hasNoTypeClasses 'writeReadWith
170inspect $ hasNoTypeClasses 'writeReadWith
172inspect $ 'writeReadWith `hasNoType` ''Step
171inspect $ 'writeReadWith `hasNoType` ''Step
173inspect $ 'writeReadWith `hasNoType` ''IUF.ConcatState -- FH.read/UF.many
172inspect $ 'writeReadWith `hasNoType` ''IUF.ConcatState -- FH.read/UF.many
174−inspect $ 'writeReadWith `hasNoType` ''AT.ArrayUnsafe -- FH.write/writeNUnsafe
173+inspect $ 'writeReadWith `hasNoType` ''MutArray.ArrayUnsafe -- FH.write/writeNUnsafe
175 -- FH.read/A.read
174 -- FH.read/A.read
176#endif
175#endif
177
176
@@ -188,7 +187,7 @@ writeRead inh devNull = IUF.fold fld unf inh
188inspect $ hasNoTypeClasses 'writeRead
187inspect $ hasNoTypeClasses 'writeRead
189inspect $ 'writeRead `hasNoType` ''Step
188inspect $ 'writeRead `hasNoType` ''Step
190inspect $ 'writeRead `hasNoType` ''IUF.ConcatState -- FH.read/UF.many
189inspect $ 'writeRead `hasNoType` ''IUF.ConcatState -- FH.read/UF.many
191−inspect $ 'writeRead `hasNoType` ''AT.ArrayUnsafe -- FH.write/writeNUnsafe
190+inspect $ 'writeRead `hasNoType` ''MutArray.ArrayUnsafe -- FH.write/writeNUnsafe
192 -- FH.read/A.read
191 -- FH.read/A.read
193#endif
192#endif
194
193
benchmark/Streamly/Benchmark/Unicode/Stream.hs+4−3
@@ -45,9 +45,10 @@ import Streamly.Benchmark.Common.Handle
45#ifdef INSPECTION
45#ifdef INSPECTION
46import Streamly.Internal.Data.MutByteArray (Unbox)
46import Streamly.Internal.Data.MutByteArray (Unbox)
47import Streamly.Internal.Data.Stream (Step(..))
47import Streamly.Internal.Data.Stream (Step(..))
48+import qualified Streamly.Internal.Data.Array as Array
49+import qualified Streamly.Internal.Data.MutArray as MutArray
48import qualified Streamly.Internal.Data.Fold as Fold
50import qualified Streamly.Internal.Data.Fold as Fold
49import qualified Streamly.Internal.Data.Tuple.Strict as Strict
51import qualified Streamly.Internal.Data.Tuple.Strict as Strict
50−import qualified Streamly.Internal.Data.Array as Array
51
52
52import Test.Inspection
53import Test.Inspection
53#endif
54#endif
@@ -223,7 +224,7 @@ inspect $ 'copyStreamLatin1' `hasNoType` ''Step
223inspect $ 'copyStreamLatin1' `hasNoType` ''Unfold.ConcatState -- Handle.read/UF.many
224inspect $ 'copyStreamLatin1' `hasNoType` ''Unfold.ConcatState -- Handle.read/UF.many
224
225
225inspect $ 'copyStreamLatin1' `hasNoType` ''Fold.Step
226inspect $ 'copyStreamLatin1' `hasNoType` ''Fold.Step
226−inspect $ 'copyStreamLatin1' `hasNoType` ''Array.ArrayUnsafe -- Handle.write/writeNUnsafe
227+inspect $ 'copyStreamLatin1' `hasNoType` ''MutArray.ArrayUnsafe -- Handle.write/writeNUnsafe
227 -- Handle.read/Array.read
228 -- Handle.read/Array.read
228inspect $ 'copyStreamLatin1' `hasNoType` ''Strict.Tuple3' -- Handle.write/chunksOf
229inspect $ 'copyStreamLatin1' `hasNoType` ''Strict.Tuple3' -- Handle.write/chunksOf
229#endif
230#endif
@@ -244,7 +245,7 @@ inspect $ 'copyStreamLatin1 `hasNoType` ''Unfold.ConcatState -- Handle.read/UF.m
244
245
245inspect $ 'copyStreamLatin1 `hasNoType` ''Fold.ManyState
246inspect $ 'copyStreamLatin1 `hasNoType` ''Fold.ManyState
246inspect $ 'copyStreamLatin1 `hasNoType` ''Fold.Step
247inspect $ 'copyStreamLatin1 `hasNoType` ''Fold.Step
247−inspect $ 'copyStreamLatin1 `hasNoType` ''Array.ArrayUnsafe -- Handle.write/writeNUnsafe
248+inspect $ 'copyStreamLatin1 `hasNoType` ''MutArray.ArrayUnsafe -- Handle.write/writeNUnsafe
248 -- Handle.read/Array.read
249 -- Handle.read/Array.read
249inspect $ 'copyStreamLatin1 `hasNoType` ''Strict.Tuple3' -- Handle.write/chunksOf
250inspect $ 'copyStreamLatin1 `hasNoType` ''Strict.Tuple3' -- Handle.write/chunksOf
250#endif
251#endif
core/src/Streamly/Internal/Data/Array/Type.hs+68−41
@@ -2,7 +2,6 @@
2-- |
2-- |
3-- Module : Streamly.Internal.Data.Array.Type
3-- Module : Streamly.Internal.Data.Array.Type
4-- Copyright : (c) 2020 Composewell Technologies
4-- Copyright : (c) 2020 Composewell Technologies
5−--
6-- License : BSD3-3-Clause
5-- License : BSD3-3-Clause
7-- Maintainer : streamly@composewell.com
6-- Maintainer : streamly@composewell.com
8-- Stability : experimental
7-- Stability : experimental
@@ -10,33 +9,59 @@
10--
9--
11-- See notes in "Streamly.Internal.Data.MutArray.Type"
10-- See notes in "Streamly.Internal.Data.MutArray.Type"
12--
11--
12+
13module Streamly.Internal.Data.Array.Type
13module Streamly.Internal.Data.Array.Type
14 (
14 (
15 -- ** Type
15 -- ** Type
16 -- $arrayNotes
16 -- $arrayNotes
17 Array (..)
17 Array (..)
18− , asPtrUnsafe
19− , nil
20
18
21− -- ** Freezing and Thawing
19+ -- ** Conversion
20+ -- *** Mutable and Immutable
22 , unsafeFreeze
21 , unsafeFreeze
23 , unsafeFreezeWithShrink
22 , unsafeFreezeWithShrink
24 , unsafeThaw
23 , unsafeThaw
25
24
26− -- ** Pinning and Unpinning
25+ -- *** Pinned and Unpinned
27 , pin
26 , pin
28 , unpin
27 , unpin
29 , isPinned
28 , isPinned
30
29
30+ -- *** Casting
31+ , asPtrUnsafe
32+
31 -- ** Construction
33 -- ** Construction
32− , splice
34+ , nil
33
35
34− , fromList
36+ -- *** Cloning
35− , pinnedFromList
37+ -- XXX Why would we clone an immutable array?
38+ , clone
39+ , pinnedClone
40+
41+ -- *** Slicing
42+ -- | Get a subarray without copying
43+ , splitAt
44+ , breakOn -- XXX requires MonadIO
45+
46+ -- *** Stream Folds
47+ , unsafeMakePure
48+ , writeWith
49+ , writeN
50+ , pinnedWriteN
51+ , writeNUnsafe
52+ , pinnedWriteNUnsafe
53+ -- , MA.ArrayUnsafe (..)
54+ , pinnedWriteNAligned
55+ , write
56+ , pinnedWrite
57+
58+ -- *** From containers
36 , fromListN
59 , fromListN
37 , pinnedFromListN
60 , pinnedFromListN
38− , fromListRev
61+ , fromList
62+ , pinnedFromList
39 , fromListRevN
63 , fromListRevN
64+ , fromListRev
40 , fromStreamN
65 , fromStreamN
41 , fromStream
66 , fromStream
42 , fromPureStreamN
67 , fromPureStreamN
@@ -46,56 +71,58 @@ module Streamly.Internal.Data.Array.Type
46 , fromPtrN
71 , fromPtrN
47 , fromChunksK
72 , fromChunksK
48
73
49− -- ** Split
74+ -- ** Reading
50− , breakOn
51− , splitAt
52
75
53− -- ** Cloning arrays
76+ -- *** Indexing
54− , clone
77+ , unsafeIndexIO -- XXX rename to getIndexUnsafeIO
55− , pinnedClone
78+ , getIndexUnsafe
56
79
80+ -- *** To Streams
81+ , read
82+ , readRev
83+ , toStreamK
84+ , toStreamKRev
85+
86+ -- *** To Containers
87+ , toList
88+
57− -- * Unfolds
89+ -- *** Unfolds
58− , reader
59− , readerUnsafe
60 , producer -- experimental
90 , producer -- experimental
91+ , readerUnsafe
92+ , reader
93+ , readerRev
61
94
62− -- ** Elimination
95+ -- *** Size
63− , unsafeIndexIO
64− , getIndexUnsafe
65− , byteLength
66 , length
96 , length
97+ , byteLength
67
98
99+ -- ** Folding
68 , foldl'
100 , foldl'
69 , foldr
101 , foldr
70−
71− , toStreamK
72− , toStreamKRev
73− , read
74− , readRev
75− , readerRev
76− , toList
77−
78− -- ** Folds
79− , writeWith
80− , writeN
81− , pinnedWriteN
82− , writeNUnsafe
83− , pinnedWriteNUnsafe
84− -- , MA.ArrayUnsafe (..)
85− , pinnedWriteNAligned
86− , write
87− , pinnedWrite
88− , unsafeMakePure
89 , byteCmp
102 , byteCmp
90 , byteEq
103 , byteEq
91
104
105+ -- ** Appending
106+ , splice -- XXX requires MonadIO
107+
92 -- ** Streams of arrays
108 -- ** Streams of arrays
109+ -- *** Chunk
110+ -- | Group a stream into arrays.
93 , chunksOf
111 , chunksOf
94 , pinnedChunksOf
112 , pinnedChunksOf
95 , buildChunks
113 , buildChunks
114+
115+ -- *** Split
116+ -- | Split an array into slices.
117+
118+ -- *** Concat
119+ -- | Append the arrays in a stream to form a stream of elements.
96 , concatChunks
120 , concatChunks
97 , concatChunksRev
121 , concatChunksRev
98
122
123+ -- *** Compact
124+ -- | Append the arrays in a stream to form a stream of larger arrays.
125+
99 -- ** Deprecated
126 -- ** Deprecated
100 , unsafeIndex
127 , unsafeIndex
101 , bufferChunks
128 , bufferChunks
core/src/Streamly/Internal/Data/MutArray/Type.hs+89−75
@@ -31,33 +31,44 @@ module Streamly.Internal.Data.MutArray.Type
31 -- ** Type
31 -- ** Type
32 -- $arrayNotes
32 -- $arrayNotes
33 MutArray (..)
33 MutArray (..)
34+
35+ -- ** Conversion
36+ -- *** Pinned and Unpinned
34 , pin
37 , pin
35 , unpin
38 , unpin
36 , isPinned
39 , isPinned
37
40
38− -- -- * Constructing and Writing
41+ -- ** Casting
42+ , cast
43+ , castUnsafe
44+ , asBytes
45+ , asPtrUnsafe
46+ , asUnpinnedPtrUnsafe
47+
39 -- ** Construction
48 -- ** Construction
40 , nil
49 , nil
41
50
42− -- *** Uninitialized Arrays
51+ -- *** New
52+ -- | New arrays are always empty arrays with some reserve capacity to
53+ -- extend the length without reallocating.
54+ , new
55+ , newArrayWith
43 , pinnedNew
56 , pinnedNew
44 , pinnedNewBytes
57 , pinnedNewBytes
45 , pinnedNewAligned
58 , pinnedNewAligned
46− , new
47− , newArrayWith
48
59
49− -- ** Cloning arrays
60+ -- *** Cloning
50 , clone
61 , clone
51 , pinnedClone
62 , pinnedClone
52
63
53− -- ** Slicing
64+ -- *** Slicing
54 -- | Get a subarray without copying
65 -- | Get a subarray without copying
55 , getSliceUnsafe
66 , getSliceUnsafe
56 , getSlice
67 , getSlice
57 , splitAt -- XXX should be able to express using getSlice
68 , splitAt -- XXX should be able to express using getSlice
58 , breakOn
69 , breakOn
59
70
60− -- *** From streams
71+ -- *** Stream Folds
61 , ArrayUnsafe (..)
72 , ArrayUnsafe (..)
62 , writeNWithUnsafe
73 , writeNWithUnsafe
63 , writeNWith
74 , writeNWith
@@ -107,65 +118,49 @@ module Streamly.Internal.Data.MutArray.Type
107 , swapIndices
118 , swapIndices
108 , unsafeSwapIndices
119 , unsafeSwapIndices
109
120
110− -- ** Growing and Shrinking
121+ -- ** Reading
111− -- | Arrays grow only at the end, though it is possible to grow on both sides
112− -- and therefore have a cons as well as snoc. But that will require two
113− -- bounds in the array representation.
114
122
115− -- *** Appending elements
123+ -- *** Indexing
116− , snocWith
124+ , getIndex
117− , snoc
125+ , getIndexUnsafe
118− , snocLinear
126+ , getIndices -- XXX indexReader
119− , snocMay
127+ , getIndicesWith -- XXX indexReaderWith
120− , snocUnsafe
128+ -- , getFromThenTo
121−
129+ , getIndexRev
122− -- *** Appending streams
123− , writeAppendNUnsafe
124− , writeAppendN
125− , writeAppendWith
126− , writeAppend
127−
128− -- *** Appending arrays
129− , spliceCopy
130− , spliceWith
131− , splice
132− , spliceExp
133− , spliceUnsafe
134− -- , putSlice
135− -- , appendSlice
136− -- , appendSliceFrom
137−
138− -- ** Eliminating and Reading
139−
140− -- *** To streams
141− , reader
142− , readerRevWith
143− , readerRev
144
130
145− -- *** To containers
131+ -- *** To Streams
146− , toStreamWith
147− , toStreamRevWith
148− , toStreamKWith
149− , toStreamKRevWith
150 , read
132 , read
151 , readRev
133 , readRev
134+ , toStreamWith
135+ , toStreamRevWith
152 , toStreamK
136 , toStreamK
137+ , toStreamKWith
153 , toStreamKRev
138 , toStreamKRev
139+ , toStreamKRevWith
140+
141+ -- *** To Containers
154 , toList
142 , toList
155
143
144+ -- *** Unfolds
156 -- experimental
145 -- experimental
157 , producerWith
146 , producerWith
158 , producer
147 , producer
159
148
160− -- *** Random reads
149+ , reader
161− , getIndex
150+ , readerRevWith
162− , getIndexUnsafe
151+ , readerRev
163− , getIndices
152+
164− , getIndicesWith
153+ -- ** Size and Capacity
165− -- , getFromThenTo
154+ -- *** Size
166− , getIndexRev
155+ , length
156+ , byteLength
167
157
158+ -- *** Capacity
159+ -- , capacity
160+ , byteCapacity
161+ , bytesFree
162+
168− -- ** Memory Management
163+ -- *** Capacity Management
169 , blockSize
164 , blockSize
170 , arrayChunkBytes
165 , arrayChunkBytes
171 , allocBytesToElemCount
166 , allocBytesToElemCount
@@ -174,12 +169,11 @@ module Streamly.Internal.Data.MutArray.Type
174 , resizeExp
169 , resizeExp
175 , rightSize
170 , rightSize
176
171
177− -- ** Size
172+ -- ** Folding
178− , length
173+ , foldl'
179− , byteLength
174+ , foldr
180− -- , capacity
175+ , byteCmp
181− , byteCapacity
176+ , byteEq
182− , bytesFree
183
177
184 -- ** In-place Mutation Algorithms
178 -- ** In-place Mutation Algorithms
185 , strip
179 , strip
@@ -191,19 +185,33 @@ module Streamly.Internal.Data.MutArray.Type
191 , mergeBy
185 , mergeBy
192 , bubble
186 , bubble
193
187
194− -- ** Casting
188+ -- ** Growing and Shrinking
195− , cast
189+ -- | Arrays grow only at the end, though it is possible to grow on both
196− , castUnsafe
190+ -- sides and therefore have a cons as well as snoc. But that will require
197− , asBytes
191+ -- both lower and upper bound in the array representation.
198− , asPtrUnsafe
199− , asUnpinnedPtrUnsafe
200
192
201− -- ** Folding
193+ -- *** Appending elements
202− , foldl'
194+ , snocWith
203− , foldr
195+ , snoc
204− , cmp
196+ , snocLinear
205− , byteCmp
197+ , snocMay
206− , byteEq
198+ , snocUnsafe
199+
200+ -- *** Appending streams
201+ , writeAppendNUnsafe
202+ , writeAppendN
203+ , writeAppendWith
204+ , writeAppend
205+
206+ -- *** Appending arrays
207+ , spliceCopy
208+ , spliceWith
209+ , splice
210+ , spliceExp
211+ , spliceUnsafe
212+ -- , putSlice
213+ -- , appendSlice
214+ -- , appendSliceFrom
207
215
208 -- Arrays of arrays
216 -- Arrays of arrays
209 -- We can add dimensionality parameter to the array type to get
217 -- We can add dimensionality parameter to the array type to get
@@ -211,21 +219,26 @@ module Streamly.Internal.Data.MutArray.Type
211 -- convenience wrapper on top of single dimensional arrays.
219 -- convenience wrapper on top of single dimensional arrays.
212
220
213 -- ** Streams of Arrays
221 -- ** Streams of Arrays
222+ -- *** Chunk
214− -- *** Group a stream into arrays
223+ -- | Group a stream into arrays.
215 , chunksOf
224 , chunksOf
216 , pinnedChunksOf
225 , pinnedChunksOf
217 , buildChunks
226 , buildChunks
218
227
228+ -- *** Split
219− -- *** Split an array into slices
229+ -- | Split an array into slices.
230+
220 -- , getSlicesFromLenN
231 -- , getSlicesFromLenN
221 , splitOn
232 , splitOn
222 -- , slicesOf
233 -- , slicesOf
223
234
224− -- *** Flatten a stream of arrays
235+ -- *** Concat
236+ -- | Append the arrays in a stream to form a stream of elements.
225 , concatChunks
237 , concatChunks
226 , concatChunksRev
238 , concatChunksRev
227
239
228− -- *** Compaction
240+ -- *** Compact
241+ -- | Append the arrays in a stream to form a stream of larger arrays.
229 , SpliceState (..)
242 , SpliceState (..)
230 , pCompactChunksLE
243 , pCompactChunksLE
231 , rCompactChunksLE
244 , rCompactChunksLE
@@ -247,6 +260,7 @@ module Streamly.Internal.Data.MutArray.Type
247 , fromArrayStreamK
260 , fromArrayStreamK
248 , fromStreamDN
261 , fromStreamDN
249 , fromStreamD
262 , fromStreamD
263+ , cmp
250 )
264 )
251where
265where
252
266