@@ -90,6 +90,9 @@ module Streamly.Internal.Prelude
93+ -- ** Composable Left Folds
93 -- ** Concurrent Folds
96 -- ** Concurrent Folds
94 , foldAsync
97 , foldAsync
@@ -103,7 +106,7 @@ module Streamly.Internal.Prelude
105 , product
108 , product
106− , mconcat
109+ -- , mconcat
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
119+ -- -- ** To Containers (Full Folds)
125+ -- ** Composable Left Folds
127+ , toStream -- XXX rename to write?
128+ , toStreamRev -- XXX rename to writeRev?
115 -- ** Partial Folds
130 -- ** Partial Folds
117 -- -- ** To Elements (Partial Folds)
132 -- -- ** To Elements (Partial Folds)
@@ -137,17 +152,21 @@ module Streamly.Internal.Prelude
140− -- ** To Containers
155+ -- ** Multi-Stream folds
141− , toList
156+ -- Full equivalence
142− , toListRev
157+ , eqBy
143− , toPure
158+ , cmpBy
146− -- ** Composable Left Folds
160+ -- finding subsequences
147− , fold
161+ , isPrefixOf
149− , toStream -- XXX rename to write?
166+ -- trimming sequences
150− , toStreamRev -- XXX rename to writeRev?
167+ , stripPrefix
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
161 -- ** Scanning
187 -- ** Scanning
162 -- ** Left scans
188 -- ** Left scans
@@ -193,60 +219,24 @@ module Streamly.Internal.Prelude
200− -- , timestampedR -- timer
202 -- ** Filtering
222 -- ** Filtering
205 , filterM
225 , filterM
207− -- ** Stateful Filters
227+ -- ** Mapping Filters
208− , take
228+ , mapMaybe
209− , takeByTime
229+ , mapMaybeM
211− , takeWhile
231+ -- ** Deleting Elements
221 , deleteBy
232 , deleteBy
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
227− -- ** Mapping Filters
238+ -- ** Inserting Elements
235− -- ** Scanning Filters
236− -- -- *** Searching Elements
240− -- -- *** Searching Sequences
241− -- , seqIndices -- search a sequence in the stream
243− -- -- *** Searching Multiple Sequences
244− -- , seqIndicesAny -- search any of the given sequence in the stream
246− -- -- -- ** Searching Streams
247− -- -- | Finding a stream within another stream.
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
258+ -- , timestampedR -- timer
264 -- ** Reordering
260 -- ** Reordering
265 , reverse
261 , reverse
266 , reverse'
262 , reverse'
268− -- * Multi-Stream Operations
264+ -- ** Trimming
270− -- ** Appending
266+ , takeByTime
271− , append
267+ -- , takeEnd
273− -- ** Interleaving
269+ , takeWhileM
274− , interleave
270+ -- , takeWhileEnd
275− , interleaveMin
271+ , drop
276− , interleaveSuffix
272+ , dropByTime
277− , interleaveInfix
273+ -- , dropEnd
279− , Serial.wSerialFst
275+ , dropWhileM
280− , Serial.wSerialMin
276+ -- , dropWhileEnd
303− -- ** Flattening Nested Streams
307− -- XXX add stateful concatMapWith?
311− -- ** Flattening Using Unfolds
313− , concatUnfoldInterleave
314− , concatUnfoldRoundrobin
316− -- ** Feedback Loops
317− , concatMapIterateWith
320− , concatMapTreeYieldLeavesWith
322− -- ** Inserting Streams in Streams
324− , gintercalateSuffix
331− -- -- ** Breaking
279+ -- ** Breaking
333− -- By chunks
281+ -- Binary
334 , splitAt -- spanN
282 , splitAt -- spanN
335 -- , splitIn -- sessionN
283 -- , splitIn -- sessionN
@@ -347,24 +295,31 @@ module Streamly.Internal.Prelude
347 -- , breakOnSeq
295 -- , breakOnSeq
348 -- , breakOnStream -- on a stream
296 -- , breakOnStream -- on a stream
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).
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
363 , chunksOf
299 , chunksOf
364 , chunksOf2
300 , chunksOf2
365 , arraysOf
301 , arraysOf
366 , intervalsOf
302 , intervalsOf
305+ -- -- *** Searching Elements
309+ -- -- *** Searching Sequences
310+ -- , seqIndices -- search a sequence in the stream
312+ -- -- *** Searching Multiple Sequences
313+ -- , seqIndicesAny -- search any of the given sequence in the stream
315+ -- -- -- ** Searching Streams
316+ -- -- | Finding a stream within another stream.
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).
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
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
403 , groupsBy
365 , groupsBy
404 , groupsByRolling
366 , groupsByRolling
406− -- ** Distributing
368+ -- ** Group map
407− , trace
369+ , rollingMapM
408− , tap
370+ , rollingMap
414 -- * Windowed Classification
372 -- * Windowed Classification
@@ -447,21 +405,75 @@ module Streamly.Internal.Prelude
447 -- , slidingChunkBuffer
405 -- , slidingChunkBuffer
448 -- , slidingSessionBuffer
406 -- , slidingSessionBuffer
408+ -- * Combining Streams
450− -- ** Containers of Streams
443+ -- ** Folding Containers of Streams
451 , foldWith
444 , foldWith
452 , foldMapWith
445 , foldMapWith
453 , forEachWith
446 , forEachWith
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
463− -- , stripSuffix
457+ -- ** Flattening Using Unfolds
464− -- , stripInfix
458+ , concatUnfold
459+ , concatUnfoldInterleave
460+ , concatUnfoldRoundrobin
462+ -- ** Feedback Loops
463+ , concatMapIterateWith
466+ , concatMapTreeYieldLeavesWith
469+ -- ** Inserting Streams in Streams
471+ , gintercalateSuffix
466 -- * Exceptions
478 -- * Exceptions
@@ -480,14 +492,11 @@ module Streamly.Internal.Prelude
481 -- * Transform Inner Monad
493 -- * Transform Inner Monad
482 , liftInner
494 , liftInner
483 , runReaderT
496 , runReaderT
484 , evalStateT
497 , evalStateT
485 , usingStateT
498 , usingStateT
486 , runStateT
499 , runStateT
492 -- * Diagnostics
501 -- * Diagnostics
493 , inspectMode
502 , inspectMode