on master help sign in
Rename iterateConcatMap to concatIterate etc.
a89a791Harendra Kumar
core/src/Streamly/Internal/Data/Stream/Expand.hs+69−69
@@ -120,21 +120,21 @@ module Streamly.Internal.Data.Stream.Expand
120
120
121 -- * Iterate
121 -- * Iterate
122 -- | Map and flatten Trees of Streams
122 -- | Map and flatten Trees of Streams
123− , iterateUnfoldManyDFS
123+ , unfoldIterateDfs
124− , iterateUnfoldManyBFS
124+ , unfoldIterateBfs
125− , iterateUnfoldManyBFSRev
125+ , unfoldIterateBfsRev
126
126
127− , iterateConcatMapWith
127+ , concatIterateWith
128− , iterateMergeMapWith
128+ , mergeIterateWith
129
129
130− , iterateConcatMapDFS
130+ , concatIterateDfs
131− , iterateConcatMapBFS
131+ , concatIterateBfs
132
132
133 -- More experimental ops
133 -- More experimental ops
134− , iterateConcatMapBFSRev
134+ , concatIterateBfsRev
135− , iterateLeftsConcatMapWith
135+ , concatIterateLeftsWith
136− , iterateConcatScanWith
136+ , concatIterateScanWith
137− , iterateConcatScan
137+ , concatIterateScan
138 )
138 )
139where
139where
140
140
@@ -639,7 +639,7 @@ mergeMapWith par f m =
639 (toStreamK m)
639 (toStreamK m)
640
640
641------------------------------------------------------------------------------
641------------------------------------------------------------------------------
642−-- iterateConcatMap - Map and flatten Trees of Streams
642+-- concatIterate - Map and flatten Trees of Streams
643------------------------------------------------------------------------------
643------------------------------------------------------------------------------
644
644
645-- | Yield an input element in the output stream, map a stream generator on it
645-- | Yield an input element in the output stream, map a stream generator on it
@@ -651,23 +651,23 @@ mergeMapWith par f m =
651--
651--
652-- >>> f = either Dir.readEitherPaths (const Stream.nil)
652-- >>> f = either Dir.readEitherPaths (const Stream.nil)
653-- >>> input = Stream.fromPure (Left ".")
653-- >>> input = Stream.fromPure (Left ".")
654−-- >>> ls = Stream.iterateConcatMapWith Stream.append f input
654+-- >>> ls = Stream.concatIterateWith Stream.append f input
655--
655--
656−-- Note that 'iterateM' is a special case of 'iterateConcatMapWith':
656+-- Note that 'iterateM' is a special case of 'concatIterateWith':
657--
657--
658−-- >>> iterateM f = Stream.iterateConcatMapWith Stream.append (Stream.fromEffect . f) . Stream.fromEffect
658+-- >>> iterateM f = Stream.concatIterateWith Stream.append (Stream.fromEffect . f) . Stream.fromEffect
659--
659--
660-- /CPS/
660-- /CPS/
661--
661--
662-- /Pre-release/
662-- /Pre-release/
663--
663--
664−{-# INLINE iterateConcatMapWith #-}
664+{-# INLINE concatIterateWith #-}
665−iterateConcatMapWith ::
665+concatIterateWith ::
666 (Stream m a -> Stream m a -> Stream m a)
666 (Stream m a -> Stream m a -> Stream m a)
667 -> (a -> Stream m a)
667 -> (a -> Stream m a)
668 -> Stream m a
668 -> Stream m a
669 -> Stream m a
669 -> Stream m a
670−iterateConcatMapWith combine f = iterateStream
670+concatIterateWith combine f = iterateStream
671
671
672 where
672 where
673
673
@@ -683,21 +683,21 @@ iterateConcatMapWith combine f = iterateStream
683--
683--
684-- >>> f = either (Just . Dir.readEitherPaths) (const Nothing)
684-- >>> f = either (Just . Dir.readEitherPaths) (const Nothing)
685-- >>> input = Stream.fromPure (Left ".")
685-- >>> input = Stream.fromPure (Left ".")
686−-- >>> ls = Stream.iterateConcatMapDFS f input
686+-- >>> ls = Stream.concatIterateDfs f input
687--
687--
688−-- This is equivalent to using @iterateConcatMapWith Stream.append@.
688+-- This is equivalent to using @concatIterateWith Stream.append@.
689--
689--
690-- /Pre-release/
690-- /Pre-release/
691−{-# INLINE iterateConcatMapDFS #-}
691+{-# INLINE concatIterateDfs #-}
692−iterateConcatMapDFS :: Monad m =>
692+concatIterateDfs :: Monad m =>
693 (a -> Maybe (Stream m a))
693 (a -> Maybe (Stream m a))
694 -> Stream m a
694 -> Stream m a
695 -> Stream m a
695 -> Stream m a
696−iterateConcatMapDFS f stream =
696+concatIterateDfs f stream =
697 fromStreamD
697 fromStreamD
698− $ D.iterateConcatMapDFS (fmap toStreamD . f ) (toStreamD stream)
698+ $ D.concatIterateDfs (fmap toStreamD . f ) (toStreamD stream)
699
699
700−-- | Similar to 'iterateConcatMapDFS' except that it traverses the stream in
700+-- | Similar to 'concatIterateDfs' except that it traverses the stream in
701-- breadth first style (BFS). First, all the elements in the input stream are
701-- breadth first style (BFS). First, all the elements in the input stream are
702-- emitted, and then their traversals are emitted.
702-- emitted, and then their traversals are emitted.
703--
703--
@@ -705,33 +705,33 @@ iterateConcatMapDFS f stream =
705--
705--
706-- >>> f = either (Just . Dir.readEitherPaths) (const Nothing)
706-- >>> f = either (Just . Dir.readEitherPaths) (const Nothing)
707-- >>> input = Stream.fromPure (Left ".")
707-- >>> input = Stream.fromPure (Left ".")
708−-- >>> ls = Stream.iterateConcatMapBFS f input
708+-- >>> ls = Stream.concatIterateBfs f input
709--
709--
710-- /Pre-release/
710-- /Pre-release/
711−{-# INLINE iterateConcatMapBFS #-}
711+{-# INLINE concatIterateBfs #-}
712−iterateConcatMapBFS :: Monad m =>
712+concatIterateBfs :: Monad m =>
713 (a -> Maybe (Stream m a))
713 (a -> Maybe (Stream m a))
714 -> Stream m a
714 -> Stream m a
715 -> Stream m a
715 -> Stream m a
716−iterateConcatMapBFS f stream =
716+concatIterateBfs f stream =
717 fromStreamD
717 fromStreamD
718− $ D.iterateConcatMapBFS (fmap toStreamD . f ) (toStreamD stream)
718+ $ D.concatIterateBfs (fmap toStreamD . f ) (toStreamD stream)
719
719
720−-- | Same as 'iterateConcatMapBFS' except that the traversal of the last
720+-- | Same as 'concatIterateBfs' except that the traversal of the last
721-- element on a level is emitted first and then going backwards up to the first
721-- element on a level is emitted first and then going backwards up to the first
722-- element (reversed ordering). This may be slightly faster than
722-- element (reversed ordering). This may be slightly faster than
723−-- 'iterateConcatMapBFS'.
723+-- 'concatIterateBfs'.
724--
724--
725−{-# INLINE iterateConcatMapBFSRev #-}
725+{-# INLINE concatIterateBfsRev #-}
726−iterateConcatMapBFSRev :: Monad m =>
726+concatIterateBfsRev :: Monad m =>
727 (a -> Maybe (Stream m a))
727 (a -> Maybe (Stream m a))
728 -> Stream m a
728 -> Stream m a
729 -> Stream m a
729 -> Stream m a
730−iterateConcatMapBFSRev f stream =
730+concatIterateBfsRev f stream =
731 fromStreamD
731 fromStreamD
732− $ D.iterateConcatMapBFSRev (fmap toStreamD . f ) (toStreamD stream)
732+ $ D.concatIterateBfsRev (fmap toStreamD . f ) (toStreamD stream)
733
733
734−-- | Like 'iterateConcatMapWith' but uses the pairwise flattening combinator
734+-- | Like 'concatIterateWith' but uses the pairwise flattening combinator
735-- 'mergeMapWith' for flattening the resulting streams. This can be used for a
735-- 'mergeMapWith' for flattening the resulting streams. This can be used for a
736-- balanced traversal of a tree like structure.
736-- balanced traversal of a tree like structure.
737--
737--
@@ -739,19 +739,19 @@ iterateConcatMapBFSRev f stream =
739--
739--
740-- >>> f = either Dir.readEitherPaths (const Stream.nil)
740-- >>> f = either Dir.readEitherPaths (const Stream.nil)
741-- >>> input = Stream.fromPure (Left ".")
741-- >>> input = Stream.fromPure (Left ".")
742−-- >>> ls = Stream.iterateMergeMapWith Stream.interleave f input
742+-- >>> ls = Stream.mergeIterateWith Stream.interleave f input
743--
743--
744-- /CPS/
744-- /CPS/
745--
745--
746-- /Pre-release/
746-- /Pre-release/
747--
747--
748−{-# INLINE iterateMergeMapWith #-}
748+{-# INLINE mergeIterateWith #-}
749−iterateMergeMapWith ::
749+mergeIterateWith ::
750 (Stream m a -> Stream m a -> Stream m a)
750 (Stream m a -> Stream m a -> Stream m a)
751 -> (a -> Stream m a)
751 -> (a -> Stream m a)
752 -> Stream m a
752 -> Stream m a
753 -> Stream m a
753 -> Stream m a
754−iterateMergeMapWith combine f = iterateStream
754+mergeIterateWith combine f = iterateStream
755
755
756 where
756 where
757
757
@@ -759,34 +759,34 @@ iterateMergeMapWith combine f = iterateStream
759
759
760 generate x = x `cons` iterateStream (f x)
760 generate x = x `cons` iterateStream (f x)
761
761
762−-- | Same as @iterateConcatMapDFS@ but more efficient due to stream fusion.
762+-- | Same as @concatIterateDfs@ but more efficient due to stream fusion.
763--
763--
764-- Example, list a directory tree using DFS:
764-- Example, list a directory tree using DFS:
765--
765--
766-- >>> f = Unfold.either Dir.eitherReaderPaths Unfold.nil
766-- >>> f = Unfold.either Dir.eitherReaderPaths Unfold.nil
767-- >>> input = Stream.fromPure (Left ".")
767-- >>> input = Stream.fromPure (Left ".")
768−-- >>> ls = Stream.iterateUnfoldManyDFS f input
768+-- >>> ls = Stream.unfoldIterateDfs f input
769--
769--
770-- /Pre-release/
770-- /Pre-release/
771−{-# INLINE iterateUnfoldManyDFS #-}
771+{-# INLINE unfoldIterateDfs #-}
772−iterateUnfoldManyDFS :: Monad m => Unfold m a a -> Stream m a -> Stream m a
772+unfoldIterateDfs :: Monad m => Unfold m a a -> Stream m a -> Stream m a
773−iterateUnfoldManyDFS u = fromStreamD . D.iterateUnfoldManyDFS u . toStreamD
773+unfoldIterateDfs u = fromStreamD . D.unfoldIterateDfs u . toStreamD
774
774
775−-- | Like 'iterateUnfoldManyDFS' but uses breadth first style traversal.
775+-- | Like 'unfoldIterateDfs' but uses breadth first style traversal.
776--
776--
777-- /Pre-release/
777-- /Pre-release/
778−{-# INLINE iterateUnfoldManyBFS #-}
778+{-# INLINE unfoldIterateBfs #-}
779−iterateUnfoldManyBFS :: Monad m => Unfold m a a -> Stream m a -> Stream m a
779+unfoldIterateBfs :: Monad m => Unfold m a a -> Stream m a -> Stream m a
780−iterateUnfoldManyBFS u = fromStreamD . D.iterateUnfoldManyBFS u . toStreamD
780+unfoldIterateBfs u = fromStreamD . D.unfoldIterateBfs u . toStreamD
781
781
782−-- | Like 'iterateUnfoldManyBFS' but processes the children in reverse order,
782+-- | Like 'unfoldIterateBfs' but processes the children in reverse order,
783-- therefore, may be slightly faster.
783-- therefore, may be slightly faster.
784--
784--
785-- /Pre-release/
785-- /Pre-release/
786−{-# INLINE iterateUnfoldManyBFSRev #-}
786+{-# INLINE unfoldIterateBfsRev #-}
787−iterateUnfoldManyBFSRev :: Monad m => Unfold m a a -> Stream m a -> Stream m a
787+unfoldIterateBfsRev :: Monad m => Unfold m a a -> Stream m a -> Stream m a
788−iterateUnfoldManyBFSRev u =
788+unfoldIterateBfsRev u =
789− fromStreamD . D.iterateUnfoldManyBFSRev u . toStreamD
789+ fromStreamD . D.unfoldIterateBfsRev u . toStreamD
790
790
791------------------------------------------------------------------------------
791------------------------------------------------------------------------------
792-- Flattening Graphs
792-- Flattening Graphs
@@ -807,15 +807,15 @@ iterateUnfoldManyBFSRev u =
807--
807--
808-- /Pre-release/
808-- /Pre-release/
809--
809--
810−{-# INLINE iterateConcatScanWith #-}
810+{-# INLINE concatIterateScanWith #-}
811−iterateConcatScanWith
811+concatIterateScanWith
812 :: Monad m
812 :: Monad m
813 => (Stream m a -> Stream m a -> Stream m a)
813 => (Stream m a -> Stream m a -> Stream m a)
814 -> (b -> a -> m (b, Stream m a))
814 -> (b -> a -> m (b, Stream m a))
815 -> m b
815 -> m b
816 -> Stream m a
816 -> Stream m a
817 -> Stream m a
817 -> Stream m a
818−iterateConcatScanWith combine f initial stream =
818+concatIterateScanWith combine f initial stream =
819 concatEffect $ do
819 concatEffect $ do
820 b <- initial
820 b <- initial
821 iterateStream (b, stream)
821 iterateStream (b, stream)
@@ -835,16 +835,16 @@ iterateConcatScanWith combine f initial stream =
835-- stream and keep building a buffered list/stream, once done we can then
835-- stream and keep building a buffered list/stream, once done we can then
836-- process the buffered stream.
836-- process the buffered stream.
837
837
838−{-# INLINE iterateConcatScan #-}
838+{-# INLINE concatIterateScan #-}
839−iterateConcatScan
839+concatIterateScan
840 :: Monad m
840 :: Monad m
841 => (b -> a -> m b)
841 => (b -> a -> m b)
842 -> (b -> m (Maybe (b, Stream m a)))
842 -> (b -> m (Maybe (b, Stream m a)))
843 -> b
843 -> b
844 -> Stream m a
844 -> Stream m a
845−iterateConcatScan scanner generate initial =
845+concatIterateScan scanner generate initial =
846 fromStreamD
846 fromStreamD
847− $ D.iterateConcatScan
847+ $ D.concatIterateScan
848 scanner (fmap (fmap (fmap toStreamD)) . generate) initial
848 scanner (fmap (fmap (fmap toStreamD)) . generate) initial
849
849
850------------------------------------------------------------------------------
850------------------------------------------------------------------------------
@@ -871,23 +871,23 @@ concatMapEitherWith = undefined
871-- This API should perhaps be removed in favor of those.
871-- This API should perhaps be removed in favor of those.
872
872
873-- | In an 'Either' stream iterate on 'Left's. This is a special case of
873-- | In an 'Either' stream iterate on 'Left's. This is a special case of
874−-- 'iterateConcatMapWith':
874+-- 'concatIterateWith':
875--
875--
876−-- >>> iterateLeftsConcatMapWith combine f = Stream.iterateConcatMapWith combine (either f (const Stream.nil))
876+-- >>> concatIterateLeftsWith combine f = Stream.concatIterateWith combine (either f (const Stream.nil))
877--
877--
878-- To traverse a directory tree:
878-- To traverse a directory tree:
879--
879--
880-- >>> input = Stream.fromPure (Left ".")
880-- >>> input = Stream.fromPure (Left ".")
881−-- >>> ls = Stream.iterateLeftsConcatMapWith Stream.append Dir.readEither input
881+-- >>> ls = Stream.concatIterateLeftsWith Stream.append Dir.readEither input
882--
882--
883-- /Pre-release/
883-- /Pre-release/
884--
884--
885−{-# INLINE iterateLeftsConcatMapWith #-}
885+{-# INLINE concatIterateLeftsWith #-}
886−iterateLeftsConcatMapWith
886+concatIterateLeftsWith
887 :: (b ~ Either a c)
887 :: (b ~ Either a c)
888 => (Stream m b -> Stream m b -> Stream m b)
888 => (Stream m b -> Stream m b -> Stream m b)
889 -> (a -> Stream m b)
889 -> (a -> Stream m b)
890 -> Stream m b
890 -> Stream m b
891 -> Stream m b
891 -> Stream m b
892−iterateLeftsConcatMapWith combine f =
892+concatIterateLeftsWith combine f =
893− iterateConcatMapWith combine (either f (const nil))
893+ concatIterateWith combine (either f (const nil))
core/src/Streamly/Internal/Data/Stream/StreamD/Type.hs+29−29
@@ -89,14 +89,14 @@ module Streamly.Internal.Data.Stream.StreamD.Type
89 , concatMapM
89 , concatMapM
90 , concatEffect
90 , concatEffect
91
91
92− , iterateUnfoldManyDFS
92+ , unfoldIterateDfs
93− , iterateUnfoldManyBFS
93+ , unfoldIterateBfs
94− , iterateUnfoldManyBFSRev
94+ , unfoldIterateBfsRev
95
95
96− , iterateConcatScan
96+ , concatIterateScan
97− , iterateConcatMapDFS
97+ , concatIterateDfs
98− , iterateConcatMapBFS
98+ , concatIterateBfs
99− , iterateConcatMapBFSRev
99+ , concatIterateBfsRev
100
100
101 , FoldMany (..) -- for inspection testing
101 , FoldMany (..) -- for inspection testing
102 , FoldManyPost (..)
102 , FoldManyPost (..)
@@ -897,13 +897,13 @@ instance Monad m => Monad (Stream m) where
897-- | Generate a stream from an initial state, scan and concat the stream,
897-- | Generate a stream from an initial state, scan and concat the stream,
898-- generate a stream again from the final state of the previous scan and repeat
898-- generate a stream again from the final state of the previous scan and repeat
899-- the process.
899-- the process.
900−{-# INLINE_NORMAL iterateConcatScan #-}
900+{-# INLINE_NORMAL concatIterateScan #-}
901−iterateConcatScan :: Monad m =>
901+concatIterateScan :: Monad m =>
902 (b -> a -> m b)
902 (b -> a -> m b)
903 -> (b -> m (Maybe (b, Stream m a)))
903 -> (b -> m (Maybe (b, Stream m a)))
904 -> b
904 -> b
905 -> Stream m a
905 -> Stream m a
906−iterateConcatScan scanner generate initial = Stream step (Left initial)
906+concatIterateScan scanner generate initial = Stream step (Left initial)
907
907
908 where
908 where
909
909
@@ -929,15 +929,15 @@ iterateConcatScan scanner generate initial = Stream step (Left initial)
929-- have to store any state. This makes the stored state proportional to the
929-- have to store any state. This makes the stored state proportional to the
930-- number of non-leaf nodes rather than total number of nodes.
930-- number of non-leaf nodes rather than total number of nodes.
931
931
932−-- | This function may be slightly faster than iterateConcatMapBFS because it
932+-- | This function may be slightly faster than concatIterateBfs because it
933-- traverses the elements on a level in reverse order, therefore, does not have
933-- traverses the elements on a level in reverse order, therefore, does not have
934-- to reverse the list stroing those.
934-- to reverse the list stroing those.
935−{-# INLINE_NORMAL iterateConcatMapBFSRev #-}
935+{-# INLINE_NORMAL concatIterateBfsRev #-}
936−iterateConcatMapBFSRev :: Monad m =>
936+concatIterateBfsRev :: Monad m =>
937 (a -> Maybe (Stream m a))
937 (a -> Maybe (Stream m a))
938 -> Stream m a
938 -> Stream m a
939 -> Stream m a
939 -> Stream m a
940−iterateConcatMapBFSRev f stream = Stream step (stream, [])
940+concatIterateBfsRev f stream = Stream step (stream, [])
941
941
942 where
942 where
943
943
@@ -957,12 +957,12 @@ iterateConcatMapBFSRev f stream = Stream step (stream, [])
957 (y:ys) -> return $ Skip (y, ys)
957 (y:ys) -> return $ Skip (y, ys)
958 [] -> return Stop
958 [] -> return Stop
959
959
960−{-# INLINE_NORMAL iterateConcatMapBFS #-}
960+{-# INLINE_NORMAL concatIterateBfs #-}
961−iterateConcatMapBFS :: Monad m =>
961+concatIterateBfs :: Monad m =>
962 (a -> Maybe (Stream m a))
962 (a -> Maybe (Stream m a))
963 -> Stream m a
963 -> Stream m a
964 -> Stream m a
964 -> Stream m a
965−iterateConcatMapBFS f stream = Stream step (stream, [], [])
965+concatIterateBfs f stream = Stream step (stream, [], [])
966
966
967 where
967 where
968
968
@@ -985,12 +985,12 @@ iterateConcatMapBFS f stream = Stream step (stream, [], [])
985 (x:xs1) -> return $ Skip (x, xs1, [])
985 (x:xs1) -> return $ Skip (x, xs1, [])
986 [] -> return Stop
986 [] -> return Stop
987
987
988−{-# INLINE_NORMAL iterateConcatMapDFS #-}
988+{-# INLINE_NORMAL concatIterateDfs #-}
989−iterateConcatMapDFS :: Monad m =>
989+concatIterateDfs :: Monad m =>
990 (a -> Maybe (Stream m a))
990 (a -> Maybe (Stream m a))
991 -> Stream m a
991 -> Stream m a
992 -> Stream m a
992 -> Stream m a
993−iterateConcatMapDFS f stream = Stream step (stream, [])
993+concatIterateDfs f stream = Stream step (stream, [])
994
994
995 where
995 where
996
996
@@ -1015,12 +1015,12 @@ data IterateUnfoldState o i =
1015 IterateUnfoldOuter o
1015 IterateUnfoldOuter o
1016 | IterateUnfoldInner o i [i]
1016 | IterateUnfoldInner o i [i]
1017
1017
1018−{-# INLINE_NORMAL iterateUnfoldManyDFS #-}
1018+{-# INLINE_NORMAL unfoldIterateDfs #-}
1019−iterateUnfoldManyDFS :: Monad m =>
1019+unfoldIterateDfs :: Monad m =>
1020 Unfold m a a
1020 Unfold m a a
1021 -> Stream m a
1021 -> Stream m a
1022 -> Stream m a
1022 -> Stream m a
1023−iterateUnfoldManyDFS (Unfold istep inject) (Stream ostep ost) =
1023+unfoldIterateDfs (Unfold istep inject) (Stream ostep ost) =
1024 Stream step (IterateUnfoldOuter ost)
1024 Stream step (IterateUnfoldOuter ost)
1025
1025
1026 where
1026 where
@@ -1052,12 +1052,12 @@ data IterateUnfoldBFSRevState o i =
1052 IterateUnfoldBFSRevOuter o [i]
1052 IterateUnfoldBFSRevOuter o [i]
1053 | IterateUnfoldBFSRevInner i [i]
1053 | IterateUnfoldBFSRevInner i [i]
1054
1054
1055−{-# INLINE_NORMAL iterateUnfoldManyBFSRev #-}
1055+{-# INLINE_NORMAL unfoldIterateBfsRev #-}
1056−iterateUnfoldManyBFSRev :: Monad m =>
1056+unfoldIterateBfsRev :: Monad m =>
1057 Unfold m a a
1057 Unfold m a a
1058 -> Stream m a
1058 -> Stream m a
1059 -> Stream m a
1059 -> Stream m a
1060−iterateUnfoldManyBFSRev (Unfold istep inject) (Stream ostep ost) =
1060+unfoldIterateBfsRev (Unfold istep inject) (Stream ostep ost) =
1061 Stream step (IterateUnfoldBFSRevOuter ost [])
1061 Stream step (IterateUnfoldBFSRevOuter ost [])
1062
1062
1063 where
1063 where
@@ -1092,12 +1092,12 @@ data IterateUnfoldBFSState o i =
1092 IterateUnfoldBFSOuter o [i]
1092 IterateUnfoldBFSOuter o [i]
1093 | IterateUnfoldBFSInner i [i] [i]
1093 | IterateUnfoldBFSInner i [i] [i]
1094
1094
1095−{-# INLINE_NORMAL iterateUnfoldManyBFS #-}
1095+{-# INLINE_NORMAL unfoldIterateBfs #-}
1096−iterateUnfoldManyBFS :: Monad m =>
1096+unfoldIterateBfs :: Monad m =>
1097 Unfold m a a
1097 Unfold m a a
1098 -> Stream m a
1098 -> Stream m a
1099 -> Stream m a
1099 -> Stream m a
1100−iterateUnfoldManyBFS (Unfold istep inject) (Stream ostep ost) =
1100+unfoldIterateBfs (Unfold istep inject) (Stream ostep ost) =
1101 Stream step (IterateUnfoldBFSOuter ost [])
1101 Stream step (IterateUnfoldBFSOuter ost [])
1102
1102
1103 where
1103 where
src/Streamly/Internal/Data/Stream/Concurrent.hs+8−7
@@ -102,8 +102,8 @@ module Streamly.Internal.Data.Stream.Concurrent
102 , concatMapInterleave
102 , concatMapInterleave
103 , parConcatMap
103 , parConcatMap
104
104
105− -- *** Iterate
105+ -- *** ConcatIterate
106− , parIterateConcatMap
106+ , parConcatIterate
107
107
108 -- ** Reactive
108 -- ** Reactive
109 , fromCallback
109 , fromCallback
@@ -705,18 +705,19 @@ parZipWith :: MonadAsync m
705parZipWith cfg f = parZipWithM cfg (\a b -> return $ f a b)
705parZipWith cfg f = parZipWithM cfg (\a b -> return $ f a b)
706
706
707-------------------------------------------------------------------------------
707-------------------------------------------------------------------------------
708−-- iterateConcatMap
708+-- concatIterate
709-------------------------------------------------------------------------------
709-------------------------------------------------------------------------------
710
710
711−-- | Same as 'iterateConcatMap' but concurrent.
711+-- | Same as 'concatIterate' but concurrent.
712--
712--
713−{-# INLINE parIterateConcatMap #-}
713+-- /Pre-release/
714−parIterateConcatMap :: MonadAsync m =>
714+{-# INLINE parConcatIterate #-}
715+parConcatIterate :: MonadAsync m =>
715 (Config -> Config)
716 (Config -> Config)
716 -> (a -> Stream m a)
717 -> (a -> Stream m a)
717 -> Stream m a
718 -> Stream m a
718 -> Stream m a
719 -> Stream m a
719−parIterateConcatMap modifier f input =
720+parConcatIterate modifier f input =
720 Stream.fromStreamK
721 Stream.fromStreamK
721 $ withChannelK modifier (Stream.toStreamK input) iterateStream
722 $ withChannelK modifier (Stream.toStreamK input) iterateStream
722
723