on master help sign in
Remove redundant exports from Fold.Combinators
commit64ec434d835cd619e8a3c0613fe248f494a35645 authorHarendra Kumar <harendra@composewell.com> dateWed 9 Aug 2023, 05:11 (3 years ago) parentb7a2e95
5 files changed+8−103
core/src/Streamly/Internal/Data/Fold.hs+1−3 core/src/Streamly/Internal/Data/Fold/Combinators.hs+1−91 core/src/Streamly/Internal/Data/Fold/Container.hs−3 core/src/Streamly/Internal/Data/Fold/Step.hs+1−1 core/src/Streamly/Internal/Data/Fold/Type.hs+5−5
core/src/Streamly/Internal/Data/Fold.hs+1−3
@@ -16,8 +16,7 @@ module Streamly.Internal.Data.Fold
1616 -- * Imports
1717 -- $setup
1818
19− module Streamly.Internal.Data.Fold.Step
20− , module Streamly.Internal.Data.Fold.Type
19+ module Streamly.Internal.Data.Fold.Type
2120 , module Streamly.Internal.Data.Fold.Tee
2221 , module Streamly.Internal.Data.Fold.Combinators
2322 , module Streamly.Internal.Data.Fold.Container
@@ -27,7 +26,6 @@ where
2726
2827import Streamly.Internal.Data.Fold.Combinators
2928import Streamly.Internal.Data.Fold.Container
30−import Streamly.Internal.Data.Fold.Step
3129import Streamly.Internal.Data.Fold.Tee
3230import Streamly.Internal.Data.Fold.Type
3331-- import Streamly.Internal.Data.Fold.Window
core/src/Streamly/Internal/Data/Fold/Combinators.hs+1−91
@@ -13,34 +13,9 @@
1313
1414module Streamly.Internal.Data.Fold.Combinators
1515 (
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−
4116 -- * Mappers
4217 -- | Monadic functions useful with mapM/lmapM on folds or streams.
43− , tracing
18+ tracing
4419 , trace
4520
4621 -- * Folds
@@ -53,7 +28,6 @@ module Streamly.Internal.Data.Fold.Combinators
5328 , foldMapM
5429
5530 -- *** Reducers
56− , drain
5731 , drainMapM
5832 , the
5933 , length
@@ -80,13 +54,10 @@ module Streamly.Internal.Data.Fold.Combinators
8054 -- | Avoid using these folds in scalable or performance critical
8155 -- applications, they buffer all the input in GC memory which can be
8256 -- detrimental to performance if the input is large.
83− , toList
8457 , toListRev
8558 -- $toListRev
8659 , toStream
8760 , toStreamRev
88− , toStreamK
89− , toStreamKRev
9061 , topBy
9162 , top
9263 , bottomBy
@@ -106,7 +77,6 @@ module Streamly.Internal.Data.Fold.Combinators
10677
10778 -- *** Filters
10879 -- | Useful in combination with the 'scanMaybe' combinator.
109− , filtering
11080 , deleteBy
11181 , uniqBy
11282 , uniq
@@ -114,13 +84,6 @@ module Streamly.Internal.Data.Fold.Combinators
11484 , findIndices
11585 , elemIndices
11686
117− -- ** Terminating Folds
118− -- *** Empty folds
119− -- | Folds that return a result without consuming any input.
120− , fromPure
121− , fromEffect
122− , fromRefold
123−
12487 -- *** Singleton folds
12588 -- | Folds that terminate after consuming exactly one input element. All
12689 -- these can be implemented in terms of the 'maybe' fold.
@@ -150,8 +113,6 @@ module Streamly.Internal.Data.Fold.Combinators
150113
151114 -- ** Trimmers
152115 -- | Useful in combination with the 'scanMaybe' combinator.
153− , taking
154− , dropping
155116 , takingEndByM
156117 , takingEndBy
157118 , takingEndByM_
@@ -165,34 +126,14 @@ module Streamly.Internal.Data.Fold.Combinators
165126 -- , breakStream
166127
167128 -- * Building Incrementally
168− , extractM
169− , reduce
170− , close
171− , isClosed
172− , snoc
173− , snocl
174− , snocM
175− , snoclM
176−
177− , addOne
178129 , addStream
179130
180131 -- * Combinators
181132 -- ** Utilities
182133 , with
183134
184− -- ** Transforming the Monad
185− , morphInner
186− , generalizeInner
187−
188− -- ** Mapping on output
189− , rmapM
190−
191135 -- ** Mapping on Input
192136 , transform
193− , lmap
194− --, lsequence
195− , lmapM
196137
197138 -- ** Sliding Window
198139 , slide2
@@ -200,7 +141,6 @@ module Streamly.Internal.Data.Fold.Combinators
200141 -- ** Scanning Input
201142 , scan
202143 , scanMany
203− , postscan
204144 , indexed
205145
206146 -- ** Zipping Input
@@ -208,19 +148,10 @@ module Streamly.Internal.Data.Fold.Combinators
208148 , zipStream
209149
210150 -- ** Filtering Input
211− , catMaybes
212151 , mapMaybeM
213152 , mapMaybe
214− , scanMaybe
215− , filter
216− , filterM
217153 , sampleFromthen
218154
219− -- Either streams
220− , catLefts
221− , catRights
222− , catEithers
223−
224155 {-
225156 -- ** Insertion
226157 -- | Insertion adds more elements to the stream.
@@ -233,7 +164,6 @@ module Streamly.Internal.Data.Fold.Combinators
233164 -}
234165
235166 -- ** Trimming
236− , take
237167
238168 -- By elements
239169 , takeEndBy
@@ -247,18 +177,13 @@ module Streamly.Internal.Data.Fold.Combinators
247177 -}
248178
249179 -- ** Serial Append
250− , splitWith
251− , split_
252180 -- , tail
253181 -- , init
254182 , splitAt -- spanN
255183 -- , splitIn -- sessionN
256184
257185 -- ** Parallel Distribution
258− , teeWith
259186 , tee
260− , teeWithFst
261− , teeWithMin
262187 , distribute
263188 -- , distributeFst
264189 -- , distributeMin
@@ -271,10 +196,6 @@ module Streamly.Internal.Data.Fold.Combinators
271196 , unzipWithFstM
272197 , unzipWithMinM
273198
274− -- ** Parallel Alternative
275− , shortest
276− , longest
277−
278199 -- ** Partitioning
279200 , partitionByM
280201 , partitionByFstM
@@ -283,23 +204,14 @@ module Streamly.Internal.Data.Fold.Combinators
283204 , partition
284205
285206 -- ** Splitting
286− , many
287− , manyPost
288− , groupsOf
289207 , chunksBetween
290− , refoldMany
291− , refoldMany1
292208 , intersperseWithQuotes
293209
294210 -- ** Nesting
295211 , unfoldMany
296212 , concatSequence
297− , concatMap
298− , duplicate
299− , refold
300213
301214 -- * Deprecated
302− , foldr
303215 , drainBy
304216 , last
305217 , head
@@ -307,7 +219,6 @@ module Streamly.Internal.Data.Fold.Combinators
307219 , mapM
308220 , variance
309221 , stdDev
310− , serialWith
311222 )
312223where
313224
@@ -347,7 +258,6 @@ import Prelude hiding
347258 , scanl, scanl1, replicate, concatMap, mconcat, unzip
348259 , span, splitAt, break, mapM, zip, maybe)
349260import Streamly.Internal.Data.Fold.Type
350−import Streamly.Internal.Data.Fold.Tee
351261
352262#include "DocTestDataFold.hs"
353263
core/src/Streamly/Internal/Data/Fold/Container.hs−3
@@ -9,9 +9,6 @@
99
1010module Streamly.Internal.Data.Fold.Container
1111 (
12− -- * Imports
13− -- $setup
14−
1512 -- * Set operations
1613 toSet
1714 , toIntSet
core/src/Streamly/Internal/Data/Fold/Step.hs+1−1
@@ -8,7 +8,7 @@
88--
99module Streamly.Internal.Data.Fold.Step
1010 (
11− -- * Types
11+ -- * Step Type
1212 Step (..)
1313
1414 , mapMStep
core/src/Streamly/Internal/Data/Fold/Type.hs+5−5
@@ -344,11 +344,9 @@
344344--
345345module Streamly.Internal.Data.Fold.Type
346346 (
347− -- * Imports
348− -- $setup
347+ module Streamly.Internal.Data.Fold.Step
349348
350− -- * Types
351− Step (..)
349+ -- * Fold Type
352350 , Fold (..)
353351
354352 -- * Constructors
@@ -450,7 +448,6 @@ import Data.Bifunctor (Bifunctor(..))
450448import Data.Either (fromLeft, fromRight, isLeft, isRight)
451449import Data.Functor.Identity (Identity(..))
452450import Fusion.Plugin.Types (Fuse(..))
453−import Streamly.Internal.Data.Fold.Step (Step(..), mapMStep, chainStepM)
454451import Streamly.Internal.Data.Maybe.Strict (Maybe'(..), toMaybe)
455452import Streamly.Internal.Data.Tuple.Strict (Tuple'(..))
456453import Streamly.Internal.Data.Refold.Type (Refold(..))
@@ -459,6 +456,9 @@ import qualified Streamly.Internal.Data.Stream.StreamK.Type as K
459456
460457import Prelude hiding (Foldable(..), concatMap, filter, map, take)
461458
459+-- Entire module is exported, do not import selectively
460+import Streamly.Internal.Data.Fold.Step
461+
462462#include "DocTestDataFold.hs"
463463
464464------------------------------------------------------------------------------