on master help sign in
Align the export list of Prelude with Internal.Prelude
e966465Harendra Kumar
src/Streamly/Internal/Prelude.hs+160−151
@@ -90,6 +90,9 @@ module Streamly.Internal.Prelude
90 , foldl1'
90 , foldl1'
91 , foldlM'
91 , foldlM'
92
92
93+ -- ** Composable Left Folds
94+ , fold
95+
93 -- ** Concurrent Folds
96 -- ** Concurrent Folds
94 , foldAsync
97 , foldAsync
95 , (|$.)
98 , (|$.)
@@ -103,7 +106,7 @@ module Streamly.Internal.Prelude
103 , length
106 , length
104 , sum
107 , sum
105 , product
108 , product
106− , mconcat
109+ -- , mconcat
107
110
108 -- -- ** To Summary (Maybe) (Full Folds)
111 -- -- ** To Summary (Maybe) (Full Folds)
109 , maximumBy
112 , maximumBy
@@ -112,6 +115,18 @@ module Streamly.Internal.Prelude
112 , minimum
115 , minimum
113 , the
116 , the
114
117
118+ -- ** Lazy Folds
119+ -- -- ** To Containers (Full Folds)
120+ , toList
121+ , toListRev
122+ , toPure
123+ , toPureRev
124+
125+ -- ** Composable Left Folds
126+
127+ , toStream -- XXX rename to write?
128+ , toStreamRev -- XXX rename to writeRev?
129+
115 -- ** Partial Folds
130 -- ** Partial Folds
116
131
117 -- -- ** To Elements (Partial Folds)
132 -- -- ** To Elements (Partial Folds)
@@ -137,17 +152,21 @@ module Streamly.Internal.Prelude
137 , and
152 , and
138 , or
153 , or
139
154
140− -- ** To Containers
155+ -- ** Multi-Stream folds
141− , toList
156+ -- Full equivalence
142− , toListRev
157+ , eqBy
143− , toPure
158+ , cmpBy
144− , toPureRev
145
159
146− -- ** Composable Left Folds
160+ -- finding subsequences
147− , fold
161+ , isPrefixOf
162+ -- , isSuffixOf
163+ -- , isInfixOf
164+ , isSubsequenceOf
148
165
149− , toStream -- XXX rename to write?
166+ -- trimming sequences
150− , toStreamRev -- XXX rename to writeRev?
167+ , stripPrefix
168+ -- , stripSuffix
169+ -- , stripInfix
151
170
152 -- * Transformation
171 -- * Transformation
153 , transform
172 , transform
@@ -156,7 +175,14 @@ module Streamly.Internal.Prelude
156 , Serial.map
175 , Serial.map
157 , sequence
176 , sequence
158 , mapM
177 , mapM
178+ -- ** Special Maps
159 , mapM_
179 , mapM_
180+ , trace
181+ , tap
182+ , tapOffsetEvery
183+ , tapAsync
184+ , tapRate
185+ , pollCounts
160
186
161 -- ** Scanning
187 -- ** Scanning
162 -- ** Left scans
188 -- ** Left scans
@@ -193,60 +219,24 @@ module Streamly.Internal.Prelude
193 , (|$)
219 , (|$)
194 , (|&)
220 , (|&)
195
221
196− -- ** Indexing
197− , indexed
198− , indexedR
199− -- , timestamped
200− -- , timestampedR -- timer
201−
202 -- ** Filtering
222 -- ** Filtering
203
223
204 , filter
224 , filter
205 , filterM
225 , filterM
206
226
207− -- ** Stateful Filters
227+ -- ** Mapping Filters
208− , take
228+ , mapMaybe
209− , takeByTime
229+ , mapMaybeM
210− -- , takeEnd
230+
211− , takeWhile
231+ -- ** Deleting Elements
212− , takeWhileM
213− -- , takeWhileEnd
214− , drop
215− , dropByTime
216− -- , dropEnd
217− , dropWhile
218− , dropWhileM
219− -- , dropWhileEnd
220− -- , dropAround
221 , deleteBy
232 , deleteBy
222 , uniq
233 , uniq
223 -- , uniqBy -- by predicate e.g. to remove duplicate "/" in a path
234 -- , uniqBy -- by predicate e.g. to remove duplicate "/" in a path
224 -- , uniqOn -- to remove duplicate sequences
235 -- , uniqOn -- to remove duplicate sequences
225 -- , pruneBy -- dropAround + uniqBy - like words
236 -- , pruneBy -- dropAround + uniqBy - like words
226
237
227− -- ** Mapping Filters
238+ -- ** Inserting Elements
228− , mapMaybe
229− , mapMaybeM
230
239
231− -- ** Window map
232− , rollingMapM
233− , rollingMap
234−
235− -- ** Scanning Filters
236− -- -- *** Searching Elements
237− , findIndices
238− , elemIndices
239−
240− -- -- *** Searching Sequences
241− -- , seqIndices -- search a sequence in the stream
242−
243− -- -- *** Searching Multiple Sequences
244− -- , seqIndicesAny -- search any of the given sequence in the stream
245−
246− -- -- -- ** Searching Streams
247− -- -- | Finding a stream within another stream.
248−
249− -- ** Insertion
250 , insertBy
240 , insertBy
251 , intersperseM
241 , intersperseM
252 , intersperse
242 , intersperse
@@ -261,76 +251,34 @@ module Streamly.Internal.Prelude
261 , interjectSuffix
251 , interjectSuffix
262 , delayPost
252 , delayPost
263
253
254+ -- ** Indexing
255+ , indexed
256+ , indexedR
257+ -- , timestamped
258+ -- , timestampedR -- timer
259+
264 -- ** Reordering
260 -- ** Reordering
265 , reverse
261 , reverse
266 , reverse'
262 , reverse'
267
263
268− -- * Multi-Stream Operations
264+ -- ** Trimming
269−
265+ , take
270− -- ** Appending
266+ , takeByTime
271− , append
267+ -- , takeEnd
272−
268+ , takeWhile
273− -- ** Interleaving
269+ , takeWhileM
274− , interleave
270+ -- , takeWhileEnd
275− , interleaveMin
271+ , drop
276− , interleaveSuffix
272+ , dropByTime
277− , interleaveInfix
273+ -- , dropEnd
278−
274+ , dropWhile
279− , Serial.wSerialFst
275+ , dropWhileM
280− , Serial.wSerialMin
276+ -- , dropWhileEnd
281−
277+ -- , dropAround
282− -- ** Scheduling
283− , roundrobin
284−
285− -- ** Parallel
286− , Par.parallelFst
287− , Par.parallelMin
288−
289− -- ** Merging
290−
291− -- , merge
292− , mergeBy
293− , mergeByM
294− , mergeAsyncBy
295− , mergeAsyncByM
296−
297− -- ** Zipping
298− , Z.zipWith
299− , Z.zipWithM
300− , Z.zipAsyncWith
301− , Z.zipAsyncWithM
302−
303− -- ** Flattening Nested Streams
304− , concatMapM
305− , concatM
306− , concatMap
307− -- XXX add stateful concatMapWith?
308− , concatMapWith
309− -- , bindWith
310−
311− -- ** Flattening Using Unfolds
312− , concatUnfold
313− , concatUnfoldInterleave
314− , concatUnfoldRoundrobin
315−
316− -- ** Feedback Loops
317− , concatMapIterateWith
318− , concatMapTreeWith
319− , concatMapLoopWith
320− , concatMapTreeYieldLeavesWith
321−
322− -- ** Inserting Streams in Streams
323− , gintercalate
324− , gintercalateSuffix
325− , intercalate
326− , intercalateSuffix
327− , interpose
328− , interposeSuffix
329− -- , interposeBy
330
278
331− -- -- ** Breaking
279+ -- ** Breaking
332
280
333− -- By chunks
281+ -- Binary
334 , splitAt -- spanN
282 , splitAt -- spanN
335 -- , splitIn -- sessionN
283 -- , splitIn -- sessionN
336
284
@@ -347,24 +295,31 @@ module Streamly.Internal.Prelude
347 -- , breakOnSeq
295 -- , breakOnSeq
348 -- , breakOnStream -- on a stream
296 -- , breakOnStream -- on a stream
349
297
350− -- ** Splitting
298+ -- Nary
351− -- | Streams can be sliced into segments in space or in time. We use the
352− -- term @chunk@ to refer to a spatial length of the stream (spatial window)
353− -- and the term @session@ to refer to a length in time (time window).
354−
355− -- In imperative terms, grouped folding can be considered as a nested loop
356− -- where we loop over the stream to group elements and then loop over
357− -- individual groups to fold them to a single value that is yielded in the
358− -- output stream.
359−
360− -- , groupScan
361−
362− -- -- *** Chunks
363 , chunksOf
299 , chunksOf
364 , chunksOf2
300 , chunksOf2
365 , arraysOf
301 , arraysOf
366 , intervalsOf
302 , intervalsOf
367
303
304+ -- ** Searching
305+ -- -- *** Searching Elements
306+ , findIndices
307+ , elemIndices
308+
309+ -- -- *** Searching Sequences
310+ -- , seqIndices -- search a sequence in the stream
311+
312+ -- -- *** Searching Multiple Sequences
313+ -- , seqIndicesAny -- search any of the given sequence in the stream
314+
315+ -- -- -- ** Searching Streams
316+ -- -- | Finding a stream within another stream.
317+
318+ -- ** Splitting
319+ -- | Streams can be sliced into segments in space or in time. We use the
320+ -- term @chunk@ to refer to a spatial length of the stream (spatial window)
321+ -- and the term @session@ to refer to a length in time (time window).
322+
368 -- -- *** Using Element Separators
323 -- -- *** Using Element Separators
369 , splitOn
324 , splitOn
370 , splitOnSuffix
325 , splitOnSuffix
@@ -399,17 +354,20 @@ module Streamly.Internal.Prelude
399 , splitInnerBySuffix
354 , splitInnerBySuffix
400
355
401 -- ** Grouping
356 -- ** Grouping
357+ -- In imperative terms, grouped folding can be considered as a nested loop
358+ -- where we loop over the stream to group elements and then loop over
359+ -- individual groups to fold them to a single value that is yielded in the
360+ -- output stream.
361+
362+ -- , groupScan
363+
402 , groups
364 , groups
403 , groupsBy
365 , groupsBy
404 , groupsByRolling
366 , groupsByRolling
405
367
406− -- ** Distributing
368+ -- ** Group map
407− , trace
369+ , rollingMapM
408− , tap
370+ , rollingMap
409− , tapOffsetEvery
410− , tapAsync
411− , tapRate
412− , pollCounts
413
371
414 -- * Windowed Classification
372 -- * Windowed Classification
415
373
@@ -447,21 +405,75 @@ module Streamly.Internal.Prelude
447 -- , slidingChunkBuffer
405 -- , slidingChunkBuffer
448 -- , slidingSessionBuffer
406 -- , slidingSessionBuffer
449
407
408+ -- * Combining Streams
409+
410+ -- ** Appending
411+ , append
412+
413+ -- ** Interleaving
414+ , interleave
415+ , interleaveMin
416+ , interleaveSuffix
417+ , interleaveInfix
418+
419+ , Serial.wSerialFst
420+ , Serial.wSerialMin
421+
422+ -- ** Scheduling
423+ , roundrobin
424+
425+ -- ** Parallel
426+ , Par.parallelFst
427+ , Par.parallelMin
428+
429+ -- ** Merging
430+
431+ -- , merge
432+ , mergeBy
433+ , mergeByM
434+ , mergeAsyncBy
435+ , mergeAsyncByM
436+
437+ -- ** Zipping
438+ , Z.zipWith
439+ , Z.zipWithM
440+ , Z.zipAsyncWith
441+ , Z.zipAsyncWithM
442+
450− -- ** Containers of Streams
443+ -- ** Folding Containers of Streams
451 , foldWith
444 , foldWith
452 , foldMapWith
445 , foldMapWith
453 , forEachWith
446 , forEachWith
454
447
448+ -- Flattening Nested Streams
455− -- ** Folding
449+ -- ** Folding Streams of Streams
456− , eqBy
450+ , concatMapM
457− , cmpBy
451+ , concatM
458− , isPrefixOf
452+ , concatMap
459− -- , isSuffixOf
453+ -- XXX add stateful concatMapWith?
460− -- , isInfixOf
454+ , concatMapWith
461− , isSubsequenceOf
455+ -- , bindWith
462− , stripPrefix
456+
463− -- , stripSuffix
457+ -- ** Flattening Using Unfolds
464− -- , stripInfix
458+ , concatUnfold
459+ , concatUnfoldInterleave
460+ , concatUnfoldRoundrobin
461+
462+ -- ** Feedback Loops
463+ , concatMapIterateWith
464+ , concatMapTreeWith
465+ , concatMapLoopWith
466+ , concatMapTreeYieldLeavesWith
467+ , K.mfix
468+
469+ -- ** Inserting Streams in Streams
470+ , gintercalate
471+ , gintercalateSuffix
472+ , intercalate
473+ , intercalateSuffix
474+ , interpose
475+ , interposeSuffix
476+ -- , interposeBy
465
477
466 -- * Exceptions
478 -- * Exceptions
467 , before
479 , before
@@ -480,14 +492,11 @@ module Streamly.Internal.Prelude
480
492
481 -- * Transform Inner Monad
493 -- * Transform Inner Monad
482 , liftInner
494 , liftInner
495+ , usingReaderT
483 , runReaderT
496 , runReaderT
484 , evalStateT
497 , evalStateT
485 , usingStateT
498 , usingStateT
486 , runStateT
499 , runStateT
487− , usingReaderT
488−
489− -- * MonadFix
490− , K.mfix
491
500
492 -- * Diagnostics
501 -- * Diagnostics
493 , inspectMode
502 , inspectMode