@@ -13,34 +13,9 @@
14module Streamly.Internal.Data.Fold.Combinators
14module Streamly.Internal.Data.Fold.Combinators
25− -- | Which constructor to use?
27− -- * @foldl*@: If the fold never terminates i.e. does not use the 'Done'
28− -- constructor otherwise use the @foldt*@ variants.
29− -- * @*M@: Use the @M@ suffix variants if any of the step, initial, or
30− -- extract function is monadic, otherwise use the pure variants.
41 -- * Mappers
16 -- * Mappers
42 -- | Monadic functions useful with mapM/lmapM on folds or streams.
17 -- | Monadic functions useful with mapM/lmapM on folds or streams.
46 -- * Folds
21 -- * Folds
@@ -53,7 +28,6 @@ module Streamly.Internal.Data.Fold.Combinators
53 , foldMapM
28 , foldMapM
55 -- *** Reducers
30 -- *** Reducers
57 , drainMapM
31 , drainMapM
@@ -80,13 +54,10 @@ module Streamly.Internal.Data.Fold.Combinators
80 -- | Avoid using these folds in scalable or performance critical
54 -- | Avoid using these folds in scalable or performance critical
81 -- applications, they buffer all the input in GC memory which can be
55 -- applications, they buffer all the input in GC memory which can be
82 -- detrimental to performance if the input is large.
56 -- detrimental to performance if the input is large.
84 , toListRev
57 , toListRev
85 -- $toListRev
58 -- $toListRev
86 , toStream
59 , toStream
87 , toStreamRev
60 , toStreamRev
92 , bottomBy
63 , bottomBy
@@ -106,7 +77,6 @@ module Streamly.Internal.Data.Fold.Combinators
107 -- *** Filters
78 -- *** Filters
108 -- | Useful in combination with the 'scanMaybe' combinator.
79 -- | Useful in combination with the 'scanMaybe' combinator.
110 , deleteBy
80 , deleteBy
@@ -114,13 +84,6 @@ module Streamly.Internal.Data.Fold.Combinators
114 , findIndices
84 , findIndices
115 , elemIndices
85 , elemIndices
117− -- ** Terminating Folds
119− -- | Folds that return a result without consuming any input.
124 -- *** Singleton folds
87 -- *** Singleton folds
125 -- | Folds that terminate after consuming exactly one input element. All
88 -- | Folds that terminate after consuming exactly one input element. All
126 -- these can be implemented in terms of the 'maybe' fold.
89 -- these can be implemented in terms of the 'maybe' fold.
@@ -150,8 +113,6 @@ module Streamly.Internal.Data.Fold.Combinators
151 -- ** Trimmers
114 -- ** Trimmers
152 -- | Useful in combination with the 'scanMaybe' combinator.
115 -- | Useful in combination with the 'scanMaybe' combinator.
155 , takingEndByM
116 , takingEndByM
156 , takingEndBy
117 , takingEndBy
157 , takingEndByM_
118 , takingEndByM_
@@ -165,34 +126,14 @@ module Streamly.Internal.Data.Fold.Combinators
165 -- , breakStream
126 -- , breakStream
167 -- * Building Incrementally
128 -- * Building Incrementally
178 , addStream
129 , addStream
180 -- * Combinators
131 -- * Combinators
181 -- ** Utilities
132 -- ** Utilities
184− -- ** Transforming the Monad
188− -- ** Mapping on output
191 -- ** Mapping on Input
135 -- ** Mapping on Input
192 , transform
136 , transform
197 -- ** Sliding Window
138 -- ** Sliding Window
@@ -200,7 +141,6 @@ module Streamly.Internal.Data.Fold.Combinators
200 -- ** Scanning Input
141 -- ** Scanning Input
202 , scanMany
143 , scanMany
204 , indexed
144 , indexed
206 -- ** Zipping Input
146 -- ** Zipping Input
@@ -208,19 +148,10 @@ module Streamly.Internal.Data.Fold.Combinators
208 , zipStream
148 , zipStream
210 -- ** Filtering Input
150 -- ** Filtering Input
212 , mapMaybeM
151 , mapMaybeM
213 , mapMaybe
152 , mapMaybe
217 , sampleFromthen
153 , sampleFromthen
225 -- ** Insertion
156 -- ** Insertion
226 -- | Insertion adds more elements to the stream.
157 -- | Insertion adds more elements to the stream.
@@ -233,7 +164,6 @@ module Streamly.Internal.Data.Fold.Combinators
235 -- ** Trimming
166 -- ** Trimming
238 -- By elements
168 -- By elements
239 , takeEndBy
169 , takeEndBy
@@ -247,18 +177,13 @@ module Streamly.Internal.Data.Fold.Combinators
249 -- ** Serial Append
179 -- ** Serial Append
252 -- , tail
180 -- , tail
253 -- , init
181 -- , init
254 , splitAt -- spanN
182 , splitAt -- spanN
255 -- , splitIn -- sessionN
183 -- , splitIn -- sessionN
257 -- ** Parallel Distribution
185 -- ** Parallel Distribution
262 , distribute
187 , distribute
263 -- , distributeFst
188 -- , distributeFst
264 -- , distributeMin
189 -- , distributeMin
@@ -271,10 +196,6 @@ module Streamly.Internal.Data.Fold.Combinators
271 , unzipWithFstM
196 , unzipWithFstM
272 , unzipWithMinM
197 , unzipWithMinM
274− -- ** Parallel Alternative
278 -- ** Partitioning
199 -- ** Partitioning
279 , partitionByM
200 , partitionByM
280 , partitionByFstM
201 , partitionByFstM
@@ -283,23 +204,14 @@ module Streamly.Internal.Data.Fold.Combinators
283 , partition
204 , partition
285 -- ** Splitting
206 -- ** Splitting
289 , chunksBetween
207 , chunksBetween
292 , intersperseWithQuotes
208 , intersperseWithQuotes
294 -- ** Nesting
210 -- ** Nesting
295 , unfoldMany
211 , unfoldMany
296 , concatSequence
212 , concatSequence
301 -- * Deprecated
214 -- * Deprecated
303 , drainBy
215 , drainBy
@@ -307,7 +219,6 @@ module Streamly.Internal.Data.Fold.Combinators
308 , variance
220 , variance
@@ -347,7 +258,6 @@ import Prelude hiding
347 , scanl, scanl1, replicate, concatMap, mconcat, unzip
258 , scanl, scanl1, replicate, concatMap, mconcat, unzip
348 , span, splitAt, break, mapM, zip, maybe)
259 , span, splitAt, break, mapM, zip, maybe)
349import Streamly.Internal.Data.Fold.Type
260import Streamly.Internal.Data.Fold.Type
350−import Streamly.Internal.Data.Fold.Tee
352#include "DocTestDataFold.hs"
262#include "DocTestDataFold.hs"