@@ -232,7 +232,7 @@ module Streamly.Prelude.Internal
232232 -- ** Nested Streams
233233 , concatMapM
234234 , concatMap
235− , K.concatMapBy
235+ , concatMapWith
236236 -- , interposeBy
237237 -- , intercalate
238238
@@ -2056,11 +2056,31 @@ mergeAsyncByM f m1 m2 = K.mkStream $ \st stp sng yld -> do
20562056-- Nesting
20572057------------------------------------------------------------------------------
20582058
2059+-- | @concatMapWith merge map stream@ is a two dimensional looping combinator.
2060+-- The first argument specifies a merge or concat function that is used to
2061+-- merge the streams generated by applying the second argument i.e. the @map@
2062+-- function to each element of the input stream. The concat function could be
2063+-- 'serial', 'parallel', 'async', 'ahead' or any other zip or merge function
2064+-- and the second argument could be any stream generation function using a
2065+-- seed.
2066+--
2067+-- /Compare 'foldMapWith'/
2068+--
2069+-- @since 0.7.0
2070+{-# INLINE concatMapWith #-}
2071+concatMapWith
2072+ :: IsStream t
2073+ => (forall c. t m c -> t m c -> t m c)
2074+ -> (a -> t m b)
2075+ -> t m a
2076+ -> t m b
2077+concatMapWith = K.concatMapBy
2078+
20592079-- | Map a stream producing function on each element of the stream and then
20602080-- flatten the results into a single stream.
20612081--
20622082-- @
2063−-- concatMap = 'concatMapBy' 'Serial.serial'
2083+-- concatMap = 'concatMapWith' 'Serial.serial'
20642084-- concatMap f = 'concatMapM' (return . f)
20652085-- @
20662086--