on master help sign in
rename sessionsOf to intervalsOf
commitfab673421462f595ff988c15fe216b2a891363ea authorHarendra Kumar <harendra.kumar@gmail.com> dateTue 13 Aug 2019, 15:31 (7 years ago) parentf21a5b8
2 files changed+6−6
src/Streamly/Prelude.hs+1−1 src/Streamly/Prelude/Internal.hs+5−5
src/Streamly/Prelude.hs+1−1
@@ -457,7 +457,7 @@ module Streamly.Prelude
457457 -- , groupScan
458458
459459 , chunksOf
460− , sessionsOf
460+ , intervalsOf
461461
462462 -- ** Searching
463463 -- | Finding the presence or location of an element, a sequence of elements
src/Streamly/Prelude/Internal.hs+5−5
@@ -259,7 +259,7 @@ module Streamly.Prelude.Internal
259259
260260 -- -- *** Chunks
261261 , chunksOf
262− , sessionsOf
262+ , intervalsOf
263263
264264 -- -- *** Using Element Separators
265265 , splitOn
@@ -2237,18 +2237,18 @@ chunksOf n f m = D.fromStreamD $ D.groupsOf n f (D.toStreamD m)
22372237
22382238-- XXX we can implement this by repeatedly applying the 'lrunFor' fold.
22392239-- XXX add this example after fixing the serial stream rate control
2240−-- >>> S.toList $ S.take 5 $ sessionsOf 1 FL.sum $ constRate 2 $ S.enumerateFrom 1
2240+-- >>> S.toList $ S.take 5 $ intervalsOf 1 FL.sum $ constRate 2 $ S.enumerateFrom 1
22412241-- > [3,7,11,15,19]
22422242--
22432243-- | Group the input stream into windows of @n@ second each and then fold each
22442244-- group using the provided fold function.
22452245--
22462246-- @since 0.7.0
2247−{-# INLINE sessionsOf #-}
2248−sessionsOf
2247+{-# INLINE intervalsOf #-}
2248+intervalsOf
22492249 :: (IsStream t, MonadAsync m)
22502250 => Double -> Fold m a b -> t m a -> t m b
2251−sessionsOf n f xs =
2251+intervalsOf n f xs =
22522252 splitBySuffix isNothing (FL.lcatMaybes f)
22532253 (intersperseByTime n (return Nothing) (Serial.map Just xs))
22542254