@@ -65,6 +65,8 @@ module Streamly.Internal.Data.Stream.Concurrent
66 , parZipWithM
66 , parZipWithM
67 , parZipWith
67 , parZipWith
69 -- ** List of streams
71 -- ** List of streams
70 -- | Shares a single channel across many streams.
72 -- | Shares a single channel across many streams.
@@ -582,6 +584,36 @@ parZipWith :: MonadAsync m
582 -> Stream m c
584 -> Stream m c
583parZipWith cfg f = parZipWithM cfg (\a b -> return $ f a b)
585parZipWith cfg f = parZipWithM cfg (\a b -> return $ f a b)
587+-- | Like 'mergeByM' but evaluates both the streams concurrently.
591+-- >>> parMergeByM cfg f m1 m2 = Stream.mergeByM f (Stream.parEval cfg m1) (Stream.parEval cfg m2)
593+{-# INLINE parMergeByM #-}
594+parMergeByM :: MonadAsync m
595+ => (Config -> Config)
596+ -> (a -> a -> m Ordering)
600+parMergeByM cfg f m1 m2 = Stream.mergeByM f (parEval cfg m1) (parEval cfg m2)
602+-- | Like 'mergeBy' but evaluates both the streams concurrently.
606+-- >>> parMergeBy cfg f = Stream.parMergeByM cfg (\a b -> return $ f a b)
608+{-# INLINE parMergeBy #-}
609+parMergeBy :: MonadAsync m
610+ => (Config -> Config)
611+ -> (a -> a -> Ordering)
615+parMergeBy cfg f = parMergeByM cfg (\a b -> return $ f a b)
585-------------------------------------------------------------------------------
617-------------------------------------------------------------------------------
586-- concatIterate
618-- concatIterate
587-------------------------------------------------------------------------------
619-------------------------------------------------------------------------------