on master help sign in
rename runScan to scan

Also runPostscan to postscan. This follows the naming of fold/unfold.

commit50aa8c1a9320c26b5e3c52a5e7ff1adbc7bfb599 authorHarendra Kumar <harendra.kumar@gmail.com> dateSun 29 Sep 2019, 15:55 (7 years ago) parent16c2f01
2 files changed+12−12
src/Streamly/Internal/Prelude.hs+8−8 src/Streamly/Prelude.hs+4−4
src/Streamly/Internal/Prelude.hs+8−8
@@ -149,8 +149,8 @@ module Streamly.Internal.Prelude
149149 , scanl1M'
150150
151151 -- ** Scan Using Fold
152− , runScan
153− , runPostscan
152+ , scan
153+ , postscan
154154
155155 -- , lscanl'
156156 -- , lscanlM'
@@ -1568,16 +1568,16 @@ scanl1' step m = fromStreamD $ D.scanl1' step $ toStreamD m
15681568-- | Scan a stream using the given monadic fold.
15691569--
15701570-- @since 0.7.0
1571−{-# INLINE runScan #-}
1572−runScan :: Monad m => Fold m a b -> SerialT m a -> SerialT m b
1573−runScan (Fold step begin done) = P.scanlMx' step begin done
1571+{-# INLINE scan #-}
1572+scan :: Monad m => Fold m a b -> SerialT m a -> SerialT m b
1573+scan (Fold step begin done) = P.scanlMx' step begin done
15741574
15751575-- | Postscan a stream using the given monadic fold.
15761576--
15771577-- @since 0.7.0
1578−{-# INLINE runPostscan #-}
1579−runPostscan :: Monad m => Fold m a b -> SerialT m a -> SerialT m b
1580−runPostscan (Fold step begin done) = P.postscanlMx' step begin done
1578+{-# INLINE postscan #-}
1579+postscan :: Monad m => Fold m a b -> SerialT m a -> SerialT m b
1580+postscan (Fold step begin done) = P.postscanlMx' step begin done
15811581
15821582-- XXX runPrescan
15831583
src/Streamly/Prelude.hs+4−4
@@ -348,8 +348,8 @@ module Streamly.Prelude
348348 , scanl1M'
349349
350350 -- ** Scan Using Fold
351− , runScan
352− , runPostscan
351+ , scan
352+ , postscan
353353
354354 -- , lscanl'
355355 -- , lscanlM'
@@ -911,7 +911,7 @@ import Streamly.Internal.Prelude
911911-- However, we can wrap the fold in a scan to convert it into a lazy stream of
912912-- fold steps. We can then terminate the stream whenever we want. For example,
913913--
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)
915915-- [Nothing]
916916--
917917-- The following example extracts the input stream up to a point where the
@@ -921,7 +921,7 @@ import Streamly.Internal.Prelude
921921-- > S.toList
922922-- $ S.map (fromJust . fst)
923923-- $ 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)
925925-- @
926926-- @
927927-- [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]