on master help sign in
Align the export list of Prelude with Internal.Prelude
commite966465af3955653404eeb00ade8fdd564fcf88a authorHarendra Kumar <harendra@composewell.com> dateThu 27 Feb 2020, 16:54 (7 years ago) parenta59c72c
1 file changed+160−151
src/Streamly/Internal/Prelude.hs+160−151
src/Streamly/Internal/Prelude.hs+160−151
@@ -90,6 +90,9 @@ module Streamly.Internal.Prelude
9090 , foldl1'
9191 , foldlM'
9292
93+ -- ** Composable Left Folds
94+ , fold
95+
9396 -- ** Concurrent Folds
9497 , foldAsync
9598 , (|$.)
@@ -103,7 +106,7 @@ module Streamly.Internal.Prelude
103106 , length
104107 , sum
105108 , product
106− , mconcat
109+ -- , mconcat
107110
108111 -- -- ** To Summary (Maybe) (Full Folds)
109112 , maximumBy
@@ -112,6 +115,18 @@ module Streamly.Internal.Prelude
112115 , minimum
113116 , the
114117
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+
115130 -- ** Partial Folds
116131
117132 -- -- ** To Elements (Partial Folds)
@@ -137,17 +152,21 @@ module Streamly.Internal.Prelude
137152 , and
138153 , or
139154
140− -- ** To Containers
141− , toList
142− , toListRev
143− , toPure
144− , toPureRev
155+ -- ** Multi-Stream folds
156+ -- Full equivalence
157+ , eqBy
158+ , cmpBy
145159
146− -- ** Composable Left Folds
147− , fold
160+ -- finding subsequences
161+ , isPrefixOf
162+ -- , isSuffixOf
163+ -- , isInfixOf
164+ , isSubsequenceOf
148165
149− , toStream -- XXX rename to write?
150− , toStreamRev -- XXX rename to writeRev?
166+ -- trimming sequences
167+ , stripPrefix
168+ -- , stripSuffix
169+ -- , stripInfix
151170
152171 -- * Transformation
153172 , transform
@@ -156,7 +175,14 @@ module Streamly.Internal.Prelude
156175 , Serial.map
157176 , sequence
158177 , mapM
178+ -- ** Special Maps
159179 , mapM_
180+ , trace
181+ , tap
182+ , tapOffsetEvery
183+ , tapAsync
184+ , tapRate
185+ , pollCounts
160186
161187 -- ** Scanning
162188 -- ** Left scans
@@ -193,60 +219,24 @@ module Streamly.Internal.Prelude
193219 , (|$)
194220 , (|&)
195221
196− -- ** Indexing
197− , indexed
198− , indexedR
199− -- , timestamped
200− -- , timestampedR -- timer
201−
202222 -- ** Filtering
203223
204224 , filter
205225 , filterM
206226
207− -- ** Stateful Filters
208− , take
209− , takeByTime
210− -- , takeEnd
211− , takeWhile
212− , takeWhileM
213− -- , takeWhileEnd
214− , drop
215− , dropByTime
216− -- , dropEnd
217− , dropWhile
218− , dropWhileM
219− -- , dropWhileEnd
220− -- , dropAround
227+ -- ** Mapping Filters
228+ , mapMaybe
229+ , mapMaybeM
230+
231+ -- ** Deleting Elements
221232 , deleteBy
222233 , uniq
223234 -- , uniqBy -- by predicate e.g. to remove duplicate "/" in a path
224235 -- , uniqOn -- to remove duplicate sequences
225236 -- , pruneBy -- dropAround + uniqBy - like words
226237
227− -- ** Mapping Filters
228− , mapMaybe
229− , mapMaybeM
238+ -- ** Inserting Elements
230239
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
250240 , insertBy
251241 , intersperseM
252242 , intersperse
@@ -261,76 +251,34 @@ module Streamly.Internal.Prelude
261251 , interjectSuffix
262252 , delayPost
263253
254+ -- ** Indexing
255+ , indexed
256+ , indexedR
257+ -- , timestamped
258+ -- , timestampedR -- timer
259+
264260 -- ** Reordering
265261 , reverse
266262 , reverse'
267263
268− -- * Multi-Stream Operations
269−
270− -- ** Appending
271− , append
272−
273− -- ** Interleaving
274− , interleave
275− , interleaveMin
276− , interleaveSuffix
277− , interleaveInfix
278−
279− , Serial.wSerialFst
280− , Serial.wSerialMin
281−
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
264+ -- ** Trimming
265+ , take
266+ , takeByTime
267+ -- , takeEnd
268+ , takeWhile
269+ , takeWhileM
270+ -- , takeWhileEnd
271+ , drop
272+ , dropByTime
273+ -- , dropEnd
274+ , dropWhile
275+ , dropWhileM
276+ -- , dropWhileEnd
277+ -- , dropAround
330278
331− -- -- ** Breaking
279+ -- ** Breaking
332280
333− -- By chunks
281+ -- Binary
334282 , splitAt -- spanN
335283 -- , splitIn -- sessionN
336284
@@ -347,24 +295,31 @@ module Streamly.Internal.Prelude
347295 -- , breakOnSeq
348296 -- , breakOnStream -- on a stream
349297
350− -- ** Splitting
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
298+ -- Nary
363299 , chunksOf
364300 , chunksOf2
365301 , arraysOf
366302 , intervalsOf
367303
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+
368323 -- -- *** Using Element Separators
369324 , splitOn
370325 , splitOnSuffix
@@ -399,17 +354,20 @@ module Streamly.Internal.Prelude
399354 , splitInnerBySuffix
400355
401356 -- ** 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+
402364 , groups
403365 , groupsBy
404366 , groupsByRolling
405367
406− -- ** Distributing
407− , trace
408− , tap
409− , tapOffsetEvery
410− , tapAsync
411− , tapRate
412− , pollCounts
368+ -- ** Group map
369+ , rollingMapM
370+ , rollingMap
413371
414372 -- * Windowed Classification
415373
@@ -447,21 +405,75 @@ module Streamly.Internal.Prelude
447405 -- , slidingChunkBuffer
448406 -- , slidingSessionBuffer
449407
450− -- ** Containers of Streams
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+
443+ -- ** Folding Containers of Streams
451444 , foldWith
452445 , foldMapWith
453446 , forEachWith
454447
455− -- ** Folding
456− , eqBy
457− , cmpBy
458− , isPrefixOf
459− -- , isSuffixOf
460− -- , isInfixOf
461− , isSubsequenceOf
462− , stripPrefix
463− -- , stripSuffix
464− -- , stripInfix
448+ -- Flattening Nested Streams
449+ -- ** Folding Streams of Streams
450+ , concatMapM
451+ , concatM
452+ , concatMap
453+ -- XXX add stateful concatMapWith?
454+ , concatMapWith
455+ -- , bindWith
456+
457+ -- ** Flattening Using Unfolds
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
465477
466478 -- * Exceptions
467479 , before
@@ -480,14 +492,11 @@ module Streamly.Internal.Prelude
480492
481493 -- * Transform Inner Monad
482494 , liftInner
495+ , usingReaderT
483496 , runReaderT
484497 , evalStateT
485498 , usingStateT
486499 , runStateT
487− , usingReaderT
488−
489− -- * MonadFix
490− , K.mfix
491500
492501 -- * Diagnostics
493502 , inspectMode