on master help sign in
Make some doc updates to the Data.Stream module
7475d44Harendra Kumar
core/src/Streamly/Data/Stream.hs+2−3
@@ -310,6 +310,7 @@ module Streamly.Data.Stream
310 -- ** Stateless Filters
310 -- ** Stateless Filters
311 -- | 'mapMaybeM' is the most general stateless filtering operation. All
311 -- | 'mapMaybeM' is the most general stateless filtering operation. All
312 -- other filtering operations can be expressed using it.
312 -- other filtering operations can be expressed using it.
313+
313 -- EXPLANATION:
314 -- EXPLANATION:
314 -- In imperative terms a filter over a stream corresponds to a loop with a
315 -- In imperative terms a filter over a stream corresponds to a loop with a
315 -- @continue@ clause for the cases when the predicate fails.
316 -- @continue@ clause for the cases when the predicate fails.
@@ -318,6 +319,7 @@ module Streamly.Data.Stream
318 , mapMaybeM
319 , mapMaybeM
319 , filter
320 , filter
320 , filterM
321 , filterM
322+ , catMaybes
321
323
322 -- ** Stateful Filters
324 -- ** Stateful Filters
323 -- | 'scanMaybe' is the most general stateful filtering operation. The
325 -- | 'scanMaybe' is the most general stateful filtering operation. The
@@ -387,9 +389,6 @@ module Streamly.Data.Stream
387 -- element of the input stream generates another stream and then loops over
389 -- element of the input stream generates another stream and then loops over
388 -- that inner stream as well producing effects and generating a single
390 -- that inner stream as well producing effects and generating a single
389 -- output stream.
391 -- output stream.
390− -- The 'Monad' instances of different stream types provide a more
391− -- convenient way of writing nested loops. Note that the monad bind
392− -- operation is just @flip concatMap@.
393 --
392 --
394 -- One dimension loops are just a special case of nested loops. For
393 -- One dimension loops are just a special case of nested loops. For
395 -- example, 'concatMap' can degenerate to a simple map operation:
394 -- example, 'concatMap' can degenerate to a simple map operation:
core/src/Streamly/Internal/Data/Stream/StreamK/Type.hs+1−3
@@ -1023,9 +1023,7 @@ bindWith par m1 f = go m1
1023
1023
1024-- | Perform a 'concatMap' using a specified concat strategy. The first
1024-- | Perform a 'concatMap' using a specified concat strategy. The first
1025-- argument specifies a merge or concat function that is used to merge the
1025-- argument specifies a merge or concat function that is used to merge the
1026−-- streams generated by the map function. For example, the concat function
1026+-- streams generated by the map function.
1027−-- could be 'serial', 'parallel', 'async', 'ahead' or any other zip or merge
1028−-- function.
1029--
1027--
1030-- @since 0.7.0
1028-- @since 0.7.0
1031{-# INLINE concatMapWith #-}
1029{-# INLINE concatMapWith #-}
core/src/Streamly/Internal/Data/Stream/Type.hs−2
@@ -530,8 +530,6 @@ bindWith par m1 f =
530-- elements in the input @stream@ and the @mixer@ function is used to merge
530-- elements in the input @stream@ and the @mixer@ function is used to merge
531-- those streams.
531-- those streams.
532--
532--
533−-- Note we can merge streams concurrently by using a concurrent merge function.
534−--
535{-# INLINE concatMapWith #-}
533{-# INLINE concatMapWith #-}
536concatMapWith
534concatMapWith
537 :: (Stream m b -> Stream m b -> Stream m b)
535 :: (Stream m b -> Stream m b -> Stream m b)