@@ -100,7 +100,9 @@ module Streamly.Internal.Data.Fold
100 , runStep
100 , runStep
102 -- * Output Transformations
102 -- * Output Transformations
103 , sequence
104 , sequence
106 -- * Input Transformations
108 -- * Input Transformations
@@ -366,10 +368,10 @@ generally = hoist (return . runIdentity)
367-- | Flatten the monadic output of a fold to pure output.
369-- | Flatten the monadic output of a fold to pure output.
369−-- @since 0.7.0
371+-- @since 0.8.0
370−{-# INLINE sequence #-}
372+{-# INLINE rsequence #-}
371−sequence :: Monad m => Fold m a (m b) -> Fold m a b
373+rsequence :: Monad m => Fold m a (m b) -> Fold m a b
372−sequence (Fold step initial extract) = Fold step' initial1 extract'
374+rsequence (Fold step initial extract) = Fold step' initial1 extract'
@@ -384,12 +386,28 @@ sequence (Fold step initial extract) = Fold step' initial1 extract'
385 extract' = join . extract
387 extract' = join . extract
389+-- | Flatten the monadic output of a fold to pure output.
392+{-# DEPRECATED sequence "Use rsequence instead" #-}
393+{-# INLINE sequence #-}
394+sequence :: Monad m => Fold m a (m b) -> Fold m a b
397+-- | Map a monadic function on the output of a fold.
401+rmapM :: Monad m => (b -> m c) -> Fold m a b -> Fold m a c
402+rmapM f = sequence . fmap f
387-- | Map a monadic function on the output of a fold.
404-- | Map a monadic function on the output of a fold.
389-- @since 0.7.0
406-- @since 0.7.0
407+{-# DEPRECATED mapM "Use rmapM instead" #-}
390{-# INLINE mapM #-}
408{-# INLINE mapM #-}
391mapM :: Monad m => (b -> m c) -> Fold m a b -> Fold m a c
409mapM :: Monad m => (b -> m c) -> Fold m a b -> Fold m a c
392−mapM f = sequence . fmap f
410+mapM = rmapM
394-- | @mapMaybe f fold@ maps a 'Maybe' returning function @f@ on the input of
412-- | @mapMaybe f fold@ maps a 'Maybe' returning function @f@ on the input of
395-- the fold, filters out 'Nothing' elements, and return the values extracted
413-- the fold, filters out 'Nothing' elements, and return the values extracted