on master help sign in
Remove redundant exports from Fold.Combinators
64ec434Harendra Kumar
core/src/Streamly/Internal/Data/Fold.hs+1−3
@@ -16,8 +16,7 @@ module Streamly.Internal.Data.Fold
16 -- * Imports
16 -- * Imports
17 -- $setup
17 -- $setup
18
18
19− module Streamly.Internal.Data.Fold.Step
19+ module Streamly.Internal.Data.Fold.Type
20− , module Streamly.Internal.Data.Fold.Type
21 , module Streamly.Internal.Data.Fold.Tee
20 , module Streamly.Internal.Data.Fold.Tee
22 , module Streamly.Internal.Data.Fold.Combinators
21 , module Streamly.Internal.Data.Fold.Combinators
23 , module Streamly.Internal.Data.Fold.Container
22 , module Streamly.Internal.Data.Fold.Container
@@ -27,7 +26,6 @@ where
27
26
28import Streamly.Internal.Data.Fold.Combinators
27import Streamly.Internal.Data.Fold.Combinators
29import Streamly.Internal.Data.Fold.Container
28import Streamly.Internal.Data.Fold.Container
30−import Streamly.Internal.Data.Fold.Step
31import Streamly.Internal.Data.Fold.Tee
29import Streamly.Internal.Data.Fold.Tee
32import Streamly.Internal.Data.Fold.Type
30import Streamly.Internal.Data.Fold.Type
33-- import Streamly.Internal.Data.Fold.Window
31-- import Streamly.Internal.Data.Fold.Window
core/src/Streamly/Internal/Data/Fold/Combinators.hs+1−91
@@ -13,34 +13,9 @@
13
13
14module Streamly.Internal.Data.Fold.Combinators
14module Streamly.Internal.Data.Fold.Combinators
15 (
15 (
16− -- * Imports
17− -- $setup
18−
19− -- * Fold Type
20− Step (..)
21− , Fold (..)
22− , Tee (..)
23−
24− -- * Constructors
25− -- | Which constructor to use?
26− --
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.
31− --
32− , foldl'
33− , foldlM'
34− , foldl1'
35− , foldlM1'
36− , foldt'
37− , foldtM'
38− , foldr'
39− , foldrM'
40−
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.
43− , tracing
18+ tracing
44 , trace
19 , trace
45
20
46 -- * Folds
21 -- * Folds
@@ -53,7 +28,6 @@ module Streamly.Internal.Data.Fold.Combinators
53 , foldMapM
28 , foldMapM
54
29
55 -- *** Reducers
30 -- *** Reducers
56− , drain
57 , drainMapM
31 , drainMapM
58 , the
32 , the
59 , length
33 , length
@@ -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.
83− , toList
84 , toListRev
57 , toListRev
85 -- $toListRev
58 -- $toListRev
86 , toStream
59 , toStream
87 , toStreamRev
60 , toStreamRev
88− , toStreamK
89− , toStreamKRev
90 , topBy
61 , topBy
91 , top
62 , top
92 , bottomBy
63 , bottomBy
@@ -106,7 +77,6 @@ module Streamly.Internal.Data.Fold.Combinators
106
77
107 -- *** Filters
78 -- *** Filters
108 -- | Useful in combination with the 'scanMaybe' combinator.
79 -- | Useful in combination with the 'scanMaybe' combinator.
109− , filtering
110 , deleteBy
80 , deleteBy
111 , uniqBy
81 , uniqBy
112 , uniq
82 , uniq
@@ -114,13 +84,6 @@ module Streamly.Internal.Data.Fold.Combinators
114 , findIndices
84 , findIndices
115 , elemIndices
85 , elemIndices
116
86
117− -- ** Terminating Folds
118− -- *** Empty folds
119− -- | Folds that return a result without consuming any input.
120− , fromPure
121− , fromEffect
122− , fromRefold
123−
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
150
113
151 -- ** Trimmers
114 -- ** Trimmers
152 -- | Useful in combination with the 'scanMaybe' combinator.
115 -- | Useful in combination with the 'scanMaybe' combinator.
153− , taking
154− , dropping
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
166
127
167 -- * Building Incrementally
128 -- * Building Incrementally
168− , extractM
169− , reduce
170− , close
171− , isClosed
172− , snoc
173− , snocl
174− , snocM
175− , snoclM
176−
177− , addOne
178 , addStream
129 , addStream
179
130
180 -- * Combinators
131 -- * Combinators
181 -- ** Utilities
132 -- ** Utilities
182 , with
133 , with
183
134
184− -- ** Transforming the Monad
185− , morphInner
186− , generalizeInner
187−
188− -- ** Mapping on output
189− , rmapM
190−
191 -- ** Mapping on Input
135 -- ** Mapping on Input
192 , transform
136 , transform
193− , lmap
194− --, lsequence
195− , lmapM
196
137
197 -- ** Sliding Window
138 -- ** Sliding Window
198 , slide2
139 , slide2
@@ -200,7 +141,6 @@ module Streamly.Internal.Data.Fold.Combinators
200 -- ** Scanning Input
141 -- ** Scanning Input
201 , scan
142 , scan
202 , scanMany
143 , scanMany
203− , postscan
204 , indexed
144 , indexed
205
145
206 -- ** Zipping Input
146 -- ** Zipping Input
@@ -208,19 +148,10 @@ module Streamly.Internal.Data.Fold.Combinators
208 , zipStream
148 , zipStream
209
149
210 -- ** Filtering Input
150 -- ** Filtering Input
211− , catMaybes
212 , mapMaybeM
151 , mapMaybeM
213 , mapMaybe
152 , mapMaybe
214− , scanMaybe
215− , filter
216− , filterM
217 , sampleFromthen
153 , sampleFromthen
218
154
219− -- Either streams
220− , catLefts
221− , catRights
222− , catEithers
223−
224 {-
155 {-
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
233 -}
164 -}
234
165
235 -- ** Trimming
166 -- ** Trimming
236− , take
237
167
238 -- By elements
168 -- By elements
239 , takeEndBy
169 , takeEndBy
@@ -247,18 +177,13 @@ module Streamly.Internal.Data.Fold.Combinators
247 -}
177 -}
248
178
249 -- ** Serial Append
179 -- ** Serial Append
250− , splitWith
251− , split_
252 -- , tail
180 -- , tail
253 -- , init
181 -- , init
254 , splitAt -- spanN
182 , splitAt -- spanN
255 -- , splitIn -- sessionN
183 -- , splitIn -- sessionN
256
184
257 -- ** Parallel Distribution
185 -- ** Parallel Distribution
258− , teeWith
259 , tee
186 , tee
260− , teeWithFst
261− , teeWithMin
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
273
198
274− -- ** Parallel Alternative
275− , shortest
276− , longest
277−
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
284
205
285 -- ** Splitting
206 -- ** Splitting
286− , many
287− , manyPost
288− , groupsOf
289 , chunksBetween
207 , chunksBetween
290− , refoldMany
291− , refoldMany1
292 , intersperseWithQuotes
208 , intersperseWithQuotes
293
209
294 -- ** Nesting
210 -- ** Nesting
295 , unfoldMany
211 , unfoldMany
296 , concatSequence
212 , concatSequence
297− , concatMap
298− , duplicate
299− , refold
300
213
301 -- * Deprecated
214 -- * Deprecated
302− , foldr
303 , drainBy
215 , drainBy
304 , last
216 , last
305 , head
217 , head
@@ -307,7 +219,6 @@ module Streamly.Internal.Data.Fold.Combinators
307 , mapM
219 , mapM
308 , variance
220 , variance
309 , stdDev
221 , stdDev
310− , serialWith
311 )
222 )
312where
223where
313
224
@@ -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
351
261
352#include "DocTestDataFold.hs"
262#include "DocTestDataFold.hs"
353
263
core/src/Streamly/Internal/Data/Fold/Container.hs−3
@@ -9,9 +9,6 @@
9
9
10module Streamly.Internal.Data.Fold.Container
10module Streamly.Internal.Data.Fold.Container
11 (
11 (
12− -- * Imports
13− -- $setup
14−
15 -- * Set operations
12 -- * Set operations
16 toSet
13 toSet
17 , toIntSet
14 , toIntSet
core/src/Streamly/Internal/Data/Fold/Step.hs+1−1
@@ -8,7 +8,7 @@
8--
8--
9module Streamly.Internal.Data.Fold.Step
9module Streamly.Internal.Data.Fold.Step
10 (
10 (
11− -- * Types
11+ -- * Step Type
12 Step (..)
12 Step (..)
13
13
14 , mapMStep
14 , mapMStep
core/src/Streamly/Internal/Data/Fold/Type.hs+5−5
@@ -344,11 +344,9 @@
344--
344--
345module Streamly.Internal.Data.Fold.Type
345module Streamly.Internal.Data.Fold.Type
346 (
346 (
347− -- * Imports
347+ module Streamly.Internal.Data.Fold.Step
348− -- $setup
349
348
350− -- * Types
349+ -- * Fold Type
351− Step (..)
352 , Fold (..)
350 , Fold (..)
353
351
354 -- * Constructors
352 -- * Constructors
@@ -450,7 +448,6 @@ import Data.Bifunctor (Bifunctor(..))
450import Data.Either (fromLeft, fromRight, isLeft, isRight)
448import Data.Either (fromLeft, fromRight, isLeft, isRight)
451import Data.Functor.Identity (Identity(..))
449import Data.Functor.Identity (Identity(..))
452import Fusion.Plugin.Types (Fuse(..))
450import Fusion.Plugin.Types (Fuse(..))
453−import Streamly.Internal.Data.Fold.Step (Step(..), mapMStep, chainStepM)
454import Streamly.Internal.Data.Maybe.Strict (Maybe'(..), toMaybe)
451import Streamly.Internal.Data.Maybe.Strict (Maybe'(..), toMaybe)
455import Streamly.Internal.Data.Tuple.Strict (Tuple'(..))
452import Streamly.Internal.Data.Tuple.Strict (Tuple'(..))
456import Streamly.Internal.Data.Refold.Type (Refold(..))
453import Streamly.Internal.Data.Refold.Type (Refold(..))
@@ -459,6 +456,9 @@ import qualified Streamly.Internal.Data.Stream.StreamK.Type as K
459
456
460import Prelude hiding (Foldable(..), concatMap, filter, map, take)
457import Prelude hiding (Foldable(..), concatMap, filter, map, take)
461
458
459+-- Entire module is exported, do not import selectively
460+import Streamly.Internal.Data.Fold.Step
461+
462#include "DocTestDataFold.hs"
462#include "DocTestDataFold.hs"
463
463
464------------------------------------------------------------------------------
464------------------------------------------------------------------------------