@@ -11,583 +11,13 @@
1111-- experimental APIs.
1212
1313module Streamly.Internal.Data.Stream.IsStream
14− (
15− -- * Stream Types
16− -- ** Serial Streams
17− SerialT
18− , Serial
19− , WSerialT
20− , WSerial
21−
22− -- ** Speculative Streams
23− , AheadT
24− , Ahead
25−
26− -- ** Asynchronous Streams
27− , AsyncT
28− , Async
29− , WAsyncT
30− , WAsync
31− , ParallelT
32− , Parallel
33− , mkAsync
34−
35− -- ** Zipping Streams
36− , ZipSerialM
37− , ZipSerial
38− , ZipAsyncM
39− , ZipAsync
40−
41− -- * Stream Type Adapters
42− , IsStream ()
43−
44− , serially
45− , wSerially
46− , asyncly
47− , aheadly
48− , wAsyncly
49− , parallely
50− , zipSerially
51− , zipAsyncly
52− , adapt
53−
54− -- * Type Synonyms
55− , MonadAsync
56−
57− -- * Construction
58− -- ** Primitives
59− , nil
60− , nilM
61− , cons
62− , (.:)
63−
64− , consM
65− , (|:)
66−
67− -- ** From Values
68− , yield
69− , yieldM
70− , repeat
71− , repeatM
72− , replicate
73− , replicateM
74−
75− -- ** Enumeration
76− , Enumerable (..)
77− , enumerate
78− , enumerateTo
79−
80− -- ** Time Enumeration
81− , times
82− , absTimes
83− , relTimes
84− , durations
85− , ticks
86− , timeout
87− , currentTime
88−
89− -- ** From Generators
90− , unfoldr
91− , unfoldrM
92− , unfold
93− , unfold0
94− , fromIndices
95− , fromIndicesM
96−
97− -- ** Iteration
98− , iterate
99− , iterateM
100−
101− -- ** Cyclic Elements
102− , mfix
103−
104− -- ** From Containers
105− , fromList
106− , fromListM
107− , fromFoldable
108− , fromFoldableM
109− , fromPrimIORef
110− , fromCallback
111−
112− -- * Elimination
113−
114− -- ** Deconstruction
115− , uncons
116− , tail
117− , init
118−
119− -- ** Folding
120− -- ** Right Folds
121− , foldrM
122− , foldrS
123− , foldrT
124− , foldr
125−
126− -- ** Left Folds
127− , foldl'
128− , foldl1'
129− , foldlM'
130−
131− -- ** Composable Left Folds
132− -- | See "Streamly.Internal.Data.Fold"
133− , fold
134− , foldMany
135− , foldSequence
136− , foldIterate
137−
138− -- ** Parsers
139− -- | See "Streamly.Internal.Data.Parser"
140− , parse
141− , parseK
142− , parseD
143− , parseMany
144− , parseManyD
145− , parseManyTill
146− , parseSequence
147− , parseIterate
148−
149− -- ** Concurrent Folds
150− , foldAsync
151− , (|$.)
152− , (|&.)
153−
154− -- ** Full Folds
155−
156− -- -- ** To Summary (Full Folds)
157− , drain
158− , last
159− , length
160− , sum
161− , product
162− , mconcat
163−
164− -- -- ** To Summary (Maybe) (Full Folds)
165− , maximumBy
166− , maximum
167− , minimumBy
168− , minimum
169− , the
170−
171− -- ** Lazy Folds
172− -- -- ** To Containers (Full Folds)
173− , toList
174− , toListRev
175− , toPure
176− , toPureRev
177−
178− -- ** Composable Left Folds
179−
180− , toStream -- XXX rename to write?
181− , toStreamRev -- XXX rename to writeRev?
182−
183− -- ** Partial Folds
184−
185− -- -- ** To Elements (Partial Folds)
186− , drainN
187− , drainWhile
188−
189− -- -- | Folds that extract selected elements of a stream or their properties.
190− , (!!)
191− , head
192− , headElse
193− , findM
194− , find
195− , lookup
196− , findIndex
197− , elemIndex
198−
199− -- -- ** To Boolean (Partial Folds)
200− , null
201− , elem
202− , notElem
203− , all
204− , any
205− , and
206− , or
207−
208− -- ** Multi-Stream folds
209− -- Full equivalence
210− , eqBy
211− , cmpBy
212−
213− -- finding subsequences
214− , isPrefixOf
215− , isSuffixOf
216− , isInfixOf
217− , isSubsequenceOf
218−
219− -- trimming sequences
220− , stripPrefix
221− , stripSuffix
222− -- , stripInfix
223− , dropPrefix
224− , dropInfix
225− , dropSuffix
226−
227− -- * Transformation
228− , transform
229−
230− -- ** Mapping
231− , map
232− , sequence
233− , mapM
234− , smapM
235− -- $smapM_Notes
236−
237− -- ** Special Maps
238− , mapM_
239− , trace
240− , trace_
241− , tap
242− , tapOffsetEvery
243− , tapAsync
244− , tapRate
245− , pollCounts
246−
247− -- ** Scanning
248− -- ** Left scans
249− , scanl'
250− , scanlM'
251− , scanlMAfter'
252− , postscanl'
253− , postscanlM'
254− , prescanl'
255− , prescanlM'
256− , scanl1'
257− , scanl1M'
258−
259− -- ** Scan Using Fold
260− , scan
261− , postscan
262−
263− -- XXX Once we have pipes the contravariant transformations can be
264− -- represented by attaching pipes before a transformation.
265− --
266− -- , lscanl'
267− -- , lscanlM'
268− -- , lscanl1'
269− -- , lscanl1M'
270− --
271− -- , lpostscanl'
272− -- , lpostscanlM'
273− -- , lprescanl'
274− -- , lprescanlM'
275−
276− -- ** Concurrent Transformation
277− , mkParallel
278− -- Par.mkParallel
279− , applyAsync
280− , (|$)
281− , (|&)
282−
283− -- ** Filtering
284−
285− , filter
286− , filterM
287−
288− -- ** Deleting Elements
289− , deleteBy
290− , uniq
291− -- , uniqBy -- by predicate e.g. to remove duplicate "/" in a path
292− -- , uniqOn -- to remove duplicate sequences
293− -- , pruneBy -- dropAround + uniqBy - like words
294−
295− -- ** Inserting Elements
296−
297− , insertBy
298− , intersperseM
299− , intersperseM_
300− , intersperse
301− , intersperseSuffix
302− , intersperseSuffix_
303− , interspersePrefix_
304− , intersperseSuffixBySpan
305− -- , intersperseBySpan
306− -- , intersperseByIndices -- using an index function/stream
307−
308− -- time domain intersperse
309− -- , intersperseByTime
310− -- , intersperseByEvent
311− , interjectSuffix
312− , delay
313− , delayPost
314− , delayPre
315−
316− -- ** Indexing
317− , indexed
318− , indexedR
319− , timestamped
320− , timeIndexed
321− -- , timestampedR -- timer
322−
323− -- ** Reordering
324− , reverse
325− , reverse'
326−
327− -- ** Trimming
328− , take
329− -- , takeGE
330− -- , takeBetween
331− , takeByTime
332− -- , takeEnd
333− , takeWhile
334− , takeWhileM
335− -- , takeWhileEnd
336− , drop
337− , dropByTime
338− -- , dropEnd
339− , dropWhile
340− , dropWhileM
341− -- , dropWhileEnd
342− -- , dropAround
343−
344− -- ** Breaking
345−
346− -- Nary
347− , chunksOf
348− , chunksOf2
349− , arraysOf
350− , intervalsOf
351−
352− -- ** Searching
353− -- -- *** Searching Elements
354− , findIndices
355− , elemIndices
356−
357− -- -- *** Searching Sequences
358− -- , seqIndices -- search a sequence in the stream
359−
360− -- -- *** Searching Multiple Sequences
361− -- , seqIndicesAny -- search any of the given sequence in the stream
362−
363− -- -- -- ** Searching Streams
364− -- -- | Finding a stream within another stream.
365−
366− -- ** Splitting
367− -- | Streams can be sliced into segments in space or in time. We use the
368− -- term @chunk@ to refer to a spatial length of the stream (spatial window)
369− -- and the term @session@ to refer to a length in time (time window).
370−
371− -- -- *** Using Element Separators
372− , splitOn
373− , splitOnSuffix
374− -- , splitOnPrefix
375−
376− -- , splitBy
377− , splitWithSuffix
378− -- , splitByPrefix
379− , wordsBy -- stripAndCompactBy
380−
381− -- -- *** Splitting By Sequences
382− , splitOnSeq
383− , splitOnSuffixSeq
384− -- , splitOnPrefixSeq
385−
386− -- Keeping the delimiters
387− , splitBySeq
388− , splitWithSuffixSeq
389− -- , splitByPrefixSeq
390− -- , wordsBySeq
391−
392− -- Splitting using multiple sequence separators
393− -- , splitOnAnySeq
394− -- , splitOnAnySuffixSeq
395− -- , splitOnAnyPrefixSeq
396−
397− -- -- *** Splitting By Streams
398− -- -- | Splitting a stream using another stream as separator.
399−
400− -- Nested splitting
401− , splitInnerBy
402− , splitInnerBySuffix
403−
404− -- ** Grouping
405− -- In imperative terms, grouped folding can be considered as a nested loop
406− -- where we loop over the stream to group elements and then loop over
407− -- individual groups to fold them to a single value that is yielded in the
408− -- output stream.
409−
410− -- , groupScan
411−
412− , groups
413− , groupsBy
414− , groupsByRolling
415−
416− -- ** Group map
417− , rollingMapM
418− , rollingMap
419−
420− -- * Windowed Classification
421−
422− -- | Split the stream into windows or chunks in space or time. Each window
423− -- can be associated with a key, all events associated with a particular
424− -- key in the window can be folded to a single result. The stream is split
425− -- into windows of specified size, the window can be terminated early if
426− -- the closing flag is specified in the input stream.
427− --
428− -- The term "chunk" is used for a space window and the term "session" is
429− -- used for a time window.
430−
431− -- ** Tumbling Windows
432− -- | A new window starts after the previous window is finished.
433−
434− -- , classifyChunksOf
435− , classifySessionsBy
436− , classifySessionsOf
437−
438− -- ** Keep Alive Windows
439− -- | The window size is extended if an event arrives within the specified
440− -- window size. This can represent sessions with idle or inactive timeout.
441−
442− -- , classifyKeepAliveChunks
443− , classifyKeepAliveSessions
444−
445− {-
446− -- ** Sliding Windows
447− -- | A new window starts after the specified slide from the previous
448− -- window. Therefore windows can overlap.
449− , classifySlidingChunks
450− , classifySlidingSessions
451− -}
452− -- ** Sliding Window Buffers
453− -- , slidingChunkBuffer
454− -- , slidingSessionBuffer
455−
456− -- * Combining Streams
457−
458− -- ** Appending
459− , serial
460− , append
461−
462− -- ** Interleaving
463− , interleave
464− , interleaveMin
465− , interleaveSuffix
466− , interleaveInfix
467−
468− , wSerial
469− , wSerialFst
470− , wSerialMin
471−
472− -- ** Scheduling
473− , ahead
474− , async
475− , wAsync
476− , roundrobin
477−
478− -- ** Parallel
479− , parallel
480− , parallelFst
481− , parallelMin
482−
483− -- ** Merging
484− -- , merge
485− , mergeBy
486− , mergeByM
487− , mergeAsyncBy
488− , mergeAsyncByM
489−
490− -- ** Zipping
491− , zipWith
492− , zipWithM
493− , zipAsyncWith
494− , zipAsyncWithM
495−
496− -- ** Flattening a Container of Streams
497− , concatFoldableWith
498− , concatMapFoldableWith
499− , concatForFoldableWith
500−
501− -- ** Flattening a Stream of Streams
502− , concat
503− , concatM
504− , concatMap
505− , concatMapM
506− , concatMapWith
507− , concatSmapMWith
508− -- , bindWith
509−
510− -- ** Flattening Using Unfolds
511− , concatUnfold
512− , concatUnfoldInterleave
513− , concatUnfoldRoundrobin
514−
515− -- ** Flattening a Tree of Streams
516− , iterateMapWith
517−
518− -- ** Flattening a Graph of Streams
519− , iterateSmapMWith
520−
521− -- ** Inserting Streams in Streams
522− , gintercalate
523− , gintercalateSuffix
524− , intercalate
525− , intercalateSuffix
526− , interpose
527− , interposeSuffix
528− -- , interposeBy
529−
530− -- * Exceptions
531− , before
532− , after_
533− , after
534− , bracket_
535− , bracket
536− , onException
537− , finally_
538− , finally
539− , ghandle
540− , handle
541−
542− -- * Generalize Inner Monad
543− , hoist
544− , generally
545−
546− -- * Transform Inner Monad
547− , liftInner
548− , usingReaderT
549− , runReaderT
550− , evalStateT
551− , usingStateT
552− , runStateT
553−
554− -- * Maybe Streams
555− , catMaybes
556− , mapMaybe
557− , mapMaybeM
558−
559− -- * Either Streams
560− , lefts
561− , rights
562− , iterateMapLeftsWith
563−
564− -- * Concurrency Control
565− , maxThreads
566− , maxBuffer
567−
568− -- * Rate Limiting
569− , Rate (..)
570− , rate
571− , avgRate
572− , minRate
573− , maxRate
574− , constRate
575−
576− -- * Diagnostics
577− , inspectMode
578−
579− -- * Deprecated
580− , once
581− , each
582− , scanx
583− , foldx
584− , foldxM
585− , foldr1
586− , runStream
587− , runN
588− , runWhile
589− , fromHandle
590− , toHandle
14+ ( module Streamly.Internal.Data.Stream.IsStream.Types
15+ , module Streamly.Internal.Data.Stream.IsStream.Generate
16+ , module Streamly.Internal.Data.Stream.IsStream.Eliminate
17+ , module Streamly.Internal.Data.Stream.IsStream.Transform
18+ , module Streamly.Internal.Data.Stream.IsStream.Nesting
19+ , module Streamly.Internal.Data.Stream.IsStream.Exception
20+ , module Streamly.Internal.Data.Stream.IsStream.Lift
59121 )
59222where
59323
@@ -598,11 +28,3 @@ import Streamly.Internal.Data.Stream.IsStream.Lift
59828import Streamly.Internal.Data.Stream.IsStream.Nesting
59929import Streamly.Internal.Data.Stream.IsStream.Transform
60030import Streamly.Internal.Data.Stream.IsStream.Types
601−
602−import Prelude hiding
603− ( filter, drop, dropWhile, take, takeWhile, zipWith, foldr
604− , foldl, map, mapM, mapM_, sequence, all, any, sum, product, elem
605− , notElem, maximum, minimum, head, last, tail, length, null
606− , reverse, iterate, init, and, or, lookup, foldr1, (!!)
607− , scanl, scanl1, replicate, concatMap, span, splitAt, break
608− , repeat, concat, mconcat)