on master help sign in
Rename Fold.lfilter(M) to Fold.filter(M)
commit528ce847772628b36a54b823a68b12feeff98a13 authorAdithya Kumar <adithya@composewell.com> dateFri 15 Jan 2021, 15:31 (6 years ago) parent084cdea
3 files changed+17−17
src/Streamly/Data/Fold.hs+2−2 src/Streamly/Internal/Data/Fold.hs+3−3 src/Streamly/Internal/Data/Fold/Types.hs+12−12
src/Streamly/Data/Fold.hs+2−2
@@ -148,8 +148,8 @@ module Streamly.Data.Fold
148148 -- , lmapM
149149
150150 -- -- ** Filtering
151− -- , lfilter
152− -- , lfilterM
151+ -- , filter
152+ -- , filterM
153153 -- , ldeleteBy
154154 -- , luniq
155155
src/Streamly/Internal/Data/Fold.hs+3−3
@@ -111,8 +111,8 @@ module Streamly.Internal.Data.Fold
111111 --, lsequence
112112 , lmapM
113113 -- ** Filtering
114− , lfilter
115− , lfilterM
114+ , filter
115+ , filterM
116116 -- , ldeleteBy
117117 -- , luniq
118118 , lcatMaybes
@@ -403,7 +403,7 @@ mapM f = sequence . fmap f
403403-- /Internal/
404404{-# INLINE mapMaybe #-}
405405mapMaybe :: (Monad m) => (a -> Maybe b) -> Fold m b r -> Fold m a r
406−mapMaybe f = lmap f . lfilter isJust . lmap fromJust
406+mapMaybe f = lmap f . filter isJust . lmap fromJust
407407
408408------------------------------------------------------------------------------
409409-- Transformations on fold inputs
src/Streamly/Internal/Data/Fold/Types.hs+12−12
@@ -181,8 +181,8 @@ module Streamly.Internal.Data.Fold.Types
181181 -- * Transformations
182182 , lmap
183183 , lmapM
184− , lfilter
185− , lfilterM
184+ , filter
185+ , filterM
186186 , lcatMaybes
187187 , takeLE
188188 , takeByTime
@@ -230,7 +230,7 @@ import Fusion.Plugin.Types (Fuse(..))
230230import Streamly.Internal.Data.Tuple.Strict (Tuple'(..), Tuple3'(..))
231231import Streamly.Internal.Data.SVar (MonadAsync)
232232
233−import Prelude hiding (concatMap)
233+import Prelude hiding (concatMap, filter)
234234
235235------------------------------------------------------------------------------
236236-- Monadic left folds
@@ -671,22 +671,22 @@ lmapM f (Fold step begin done) = Fold step' begin done
671671
672672-- | Include only those elements that pass a predicate.
673673--
674−-- >>> S.fold (lfilter (> 5) FL.sum) [1..10]
674+-- >>> S.fold (filter (> 5) FL.sum) [1..10]
675675-- 40
676676--
677677-- @since 0.7.0
678−{-# INLINABLE lfilter #-}
679−lfilter :: Monad m => (a -> Bool) -> Fold m a r -> Fold m a r
680−lfilter f (Fold step begin done) = Fold step' begin done
678+{-# INLINABLE filter #-}
679+filter :: Monad m => (a -> Bool) -> Fold m a r -> Fold m a r
680+filter f (Fold step begin done) = Fold step' begin done
681681 where
682682 step' x a = if f a then step x a else return $ Partial x
683683
684−-- | Like 'lfilter' but with a monadic predicate.
684+-- | Like 'filter' but with a monadic predicate.
685685--
686686-- @since 0.7.0
687−{-# INLINABLE lfilterM #-}
688−lfilterM :: Monad m => (a -> m Bool) -> Fold m a r -> Fold m a r
689−lfilterM f (Fold step begin done) = Fold step' begin done
687+{-# INLINABLE filterM #-}
688+filterM :: Monad m => (a -> m Bool) -> Fold m a r -> Fold m a r
689+filterM f (Fold step begin done) = Fold step' begin done
690690 where
691691 step' x a = do
692692 use <- f a
@@ -696,7 +696,7 @@ lfilterM f (Fold step begin done) = Fold step' begin done
696696-- 'Just' values.
697697{-# INLINE lcatMaybes #-}
698698lcatMaybes :: Monad m => Fold m a b -> Fold m (Maybe a) b
699−lcatMaybes = lfilter isJust . lmap fromJust
699+lcatMaybes = filter isJust . lmap fromJust
700700
701701------------------------------------------------------------------------------
702702-- Parsing