on master help sign in
rename runScan to scan
50aa8c1Harendra Kumar
src/Streamly/Internal/Prelude.hs+8−8
@@ -149,8 +149,8 @@ module Streamly.Internal.Prelude
149 , scanl1M'
149 , scanl1M'
150
150
151 -- ** Scan Using Fold
151 -- ** Scan Using Fold
152− , runScan
152+ , scan
153− , runPostscan
153+ , postscan
154
154
155 -- , lscanl'
155 -- , lscanl'
156 -- , lscanlM'
156 -- , lscanlM'
@@ -1568,16 +1568,16 @@ scanl1' step m = fromStreamD $ D.scanl1' step $ toStreamD m
1568-- | Scan a stream using the given monadic fold.
1568-- | Scan a stream using the given monadic fold.
1569--
1569--
1570-- @since 0.7.0
1570-- @since 0.7.0
1571−{-# INLINE runScan #-}
1571+{-# INLINE scan #-}
1572−runScan :: Monad m => Fold m a b -> SerialT m a -> SerialT m b
1572+scan :: Monad m => Fold m a b -> SerialT m a -> SerialT m b
1573−runScan (Fold step begin done) = P.scanlMx' step begin done
1573+scan (Fold step begin done) = P.scanlMx' step begin done
1574
1574
1575-- | Postscan a stream using the given monadic fold.
1575-- | Postscan a stream using the given monadic fold.
1576--
1576--
1577-- @since 0.7.0
1577-- @since 0.7.0
1578−{-# INLINE runPostscan #-}
1578+{-# INLINE postscan #-}
1579−runPostscan :: Monad m => Fold m a b -> SerialT m a -> SerialT m b
1579+postscan :: Monad m => Fold m a b -> SerialT m a -> SerialT m b
1580−runPostscan (Fold step begin done) = P.postscanlMx' step begin done
1580+postscan (Fold step begin done) = P.postscanlMx' step begin done
1581
1581
1582-- XXX runPrescan
1582-- XXX runPrescan
1583
1583
src/Streamly/Prelude.hs+4−4
@@ -348,8 +348,8 @@ module Streamly.Prelude
348 , scanl1M'
348 , scanl1M'
349
349
350 -- ** Scan Using Fold
350 -- ** Scan Using Fold
351− , runScan
351+ , scan
352− , runPostscan
352+ , postscan
353
353
354 -- , lscanl'
354 -- , lscanl'
355 -- , lscanlM'
355 -- , lscanlM'
@@ -911,7 +911,7 @@ import Streamly.Internal.Prelude
911-- However, we can wrap the fold in a scan to convert it into a lazy stream of
911-- However, we can wrap the fold in a scan to convert it into a lazy stream of
912-- fold steps. We can then terminate the stream whenever we want. For example,
912-- fold steps. We can then terminate the stream whenever we want. For example,
913--
913--
914−-- >>> S.toList $ S.take 1 $ S.runScan FL.head (1 `S.cons` undefined)
914+-- >>> S.toList $ S.take 1 $ S.scan FL.head (1 `S.cons` undefined)
915-- [Nothing]
915-- [Nothing]
916--
916--
917-- The following example extracts the input stream up to a point where the
917-- The following example extracts the input stream up to a point where the
@@ -921,7 +921,7 @@ import Streamly.Internal.Prelude
921-- > S.toList
921-- > S.toList
922-- $ S.map (fromJust . fst)
922-- $ S.map (fromJust . fst)
923-- $ S.takeWhile (\\(_,x) -> x <= 10)
923-- $ S.takeWhile (\\(_,x) -> x <= 10)
924−-- $ S.runPostscan ((,) \<$> FL.last \<*> avg) (S.enumerateFromTo 1.0 100.0)
924+-- $ S.postscan ((,) \<$> FL.last \<*> avg) (S.enumerateFromTo 1.0 100.0)
925-- @
925-- @
926-- @
926-- @
927-- [1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0]
927-- [1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0]