@@ -107,7 +107,7 @@ module Streamly.Internal.Data.Fold
108 -- ** Mapping
108 -- ** Mapping
109 , transform
109 , transform
111 --, lsequence
111 --, lsequence
113 -- ** Filtering
113 -- ** Filtering
@@ -403,7 +403,7 @@ mapM f = sequence . fmap f
403-- /Internal/
403-- /Internal/
404{-# INLINE mapMaybe #-}
404{-# INLINE mapMaybe #-}
405mapMaybe :: (Monad m) => (a -> Maybe b) -> Fold m b r -> Fold m a r
405mapMaybe :: (Monad m) => (a -> Maybe b) -> Fold m b r -> Fold m a r
406−mapMaybe f = lmap f . filter isJust . lmap fromJust
406+mapMaybe f = map f . filter isJust . map fromJust
408------------------------------------------------------------------------------
408------------------------------------------------------------------------------
409-- Transformations on fold inputs
409-- Transformations on fold inputs
@@ -750,7 +750,7 @@ mconcat ::
750mconcat = sconcat mempty
750mconcat = sconcat mempty
753−-- > foldMap f = lmap f mconcat
753+-- > foldMap f = map f mconcat
755-- Make a fold from a pure function that folds the output of the function
755-- Make a fold from a pure function that folds the output of the function
756-- using 'mappend' and 'mempty'.
756-- using 'mappend' and 'mempty'.
@@ -764,7 +764,7 @@ foldMap :: (Monad m, Monoid b
764 , Semigroup b
764 , Semigroup b
766 ) => (a -> b) -> Fold m a b
766 ) => (a -> b) -> Fold m a b
767−foldMap f = lmap f mconcat
767+foldMap f = map f mconcat
770-- > foldMapM f = lmapM f mconcat
770-- > foldMapM f = lmapM f mconcat
@@ -935,7 +935,7 @@ null :: Monad m => Fold m a Bool
935null = mkFold (\() _ -> Done False) (Partial ()) (const True)
935null = mkFold (\() _ -> Done False) (Partial ()) (const True)
938−-- > any p = lmap p or
938+-- > any p = map p or
939-- > any p = fmap getAny . FL.foldMap (Any . p)
939-- > any p = fmap getAny . FL.foldMap (Any . p)
941-- | Returns 'True' if any of the elements of a stream satisfies a predicate.
941-- | Returns 'True' if any of the elements of a stream satisfies a predicate.
@@ -967,7 +967,7 @@ elem :: (Eq a, Monad m) => a -> Fold m a Bool
967elem a = any (a ==)
967elem a = any (a ==)
970−-- > all p = lmap p and
970+-- > all p = map p and
971-- > all p = fmap getAll . FL.foldMap (All . p)
971-- > all p = fmap getAll . FL.foldMap (All . p)
973-- | Returns 'True' if all elements of a stream satisfy a predicate.
973-- | Returns 'True' if all elements of a stream satisfy a predicate.
@@ -1992,11 +1992,11 @@ classifyWith f (Fold step1 initial1 extract1) = mkAccumM step initial extract
1993-- Same as:
1993-- Same as:
1995−-- > classify fld = classifyWith fst (lmap snd fld)
1995+-- > classify fld = classifyWith fst (map snd fld)
1997{-# INLINE classify #-}
1997{-# INLINE classify #-}
1998classify :: (Monad m, Ord k) => Fold m a b -> Fold m (k, a) (Map k b)
1998classify :: (Monad m, Ord k) => Fold m a b -> Fold m (k, a) (Map k b)
1999−classify fld = classifyWith fst (lmap snd fld)
1999+classify fld = classifyWith fst (map snd fld)
2001------------------------------------------------------------------------------
2001------------------------------------------------------------------------------
2002-- Unzipping
2002-- Unzipping
@@ -2086,7 +2086,7 @@ unzipWithMinM = undefined
2086-- | Split elements in the input stream into two parts using a pure splitter
2086-- | Split elements in the input stream into two parts using a pure splitter
2087-- function, direct each part to a different fold and zip the results.
2087-- function, direct each part to a different fold and zip the results.
2089−-- @unzipWith f fld1 fld2 = lmap f (unzip fld1 fld2)@
2089+-- @unzipWith f fld1 fld2 = map f (unzip fld1 fld2)@
2091-- This fold terminates when both the input folds terminate.
2091-- This fold terminates when both the input folds terminate.