@@ -1903,10 +1903,10 @@ data SessionState t m k a b = SessionState
19031903
19041904-- XXX Perhaps we should use an "Event a" type to represent timestamped data.
19051905
1906−-- | @classifySessionsBy tick timeout keepalive predicate fold stream@ classifies
1907−-- an input event @stream@ consisting of @(key, value, timestamp)@ into
1908−-- sessions based on the @key@, folding all the values corresponding to the
1909−-- same key into a session using the supplied @fold@.
1906+-- | @classifySessionsBy tick keepalive predicate timeout fold stream@
1907+-- classifies an input event @stream@ consisting of @(key, value, timestamp)@
1908+-- into sessions based on the @key@, folding all the values corresponding to
1909+-- the same key into a session using the supplied @fold@.
19101910--
19111911-- When the fold terminates or a @timeout@ occurs, a tuple consisting of the
19121912-- session key and the folded value is emitted in the output stream. The
@@ -1928,7 +1928,7 @@ data SessionState t m k a b = SessionState
19281928--
19291929-- >>> :{
19301930-- Stream.mapM_ print
1931−-- $ Stream.classifySessionsBy 1 3 False (const (return False)) (Fold.takeLE 3 Fold.toList)
1931+-- $ Stream.classifySessionsBy 1 False (const (return False)) 3 (Fold.takeLE 3 Fold.toList)
19321932-- $ Stream.map (\\(ts,(k,a)) -> (k, a, ts))
19331933-- $ Stream.timestamped
19341934-- $ Stream.delay 1
@@ -1944,13 +1944,13 @@ data SessionState t m k a b = SessionState
19441944classifySessionsBy
19451945 :: (IsStream t, MonadAsync m, Ord k)
19461946 => Double -- ^ timer tick in seconds
1947− -> Double -- ^ session timeout in seconds
1948− -> Bool -- ^ reset the timeout when an event is received
1947+ -> Bool -- ^ reset the timer when an event is received
19491948 -> (Int -> m Bool) -- ^ predicate to eject sessions based on session count
1949+ -> Double -- ^ session timeout in seconds
19501950 -> Fold m a b -- ^ Fold to be applied to session events
19511951 -> t m (k, a, AbsTime) -- ^ session key, data, timestamp
19521952 -> t m (k, b) -- ^ session key, fold result
1953−classifySessionsBy tick tmout reset ejectPred
1953+classifySessionsBy tick reset ejectPred tmout
19541954 (Fold step initial extract) str =
19551955 concatMap sessionOutputStream $
19561956 scanlMAfter' sstep (return szero) flush stream
@@ -2165,7 +2165,7 @@ classifySessionsBy tick tmout reset ejectPred
21652165-- option set to 'True'.
21662166--
21672167-- @
2168−-- classifyKeepAliveSessions timeout pred = classifySessionsBy 1 timeout True pred
2168+-- classifyKeepAliveSessions = classifySessionsBy 1 True
21692169-- @
21702170--
21712171-- /Pre-release/
@@ -2173,13 +2173,12 @@ classifySessionsBy tick tmout reset ejectPred
21732173{-# INLINABLE classifyKeepAliveSessions #-}
21742174classifyKeepAliveSessions ::
21752175 (IsStream t, MonadAsync m, Ord k)
2176− => Double -- ^ session inactive timeout
2177− -> (Int -> m Bool) -- ^ predicate to eject sessions on session count
2176+ => (Int -> m Bool) -- ^ predicate to eject sessions on session count
2177+ -> Double -- ^ session inactive timeout
21782178 -> Fold m a b -- ^ Fold to be applied to session payload data
21792179 -> t m (k, a, AbsTime) -- ^ session key, data, timestamp
21802180 -> t m (k, b)
2181−classifyKeepAliveSessions tmout =
2182− classifySessionsBy 1 tmout True
2181+classifyKeepAliveSessions = classifySessionsBy 1 True
21832182
21842183------------------------------------------------------------------------------
21852184-- Keyed tumbling windows
@@ -2213,7 +2212,7 @@ classifyChunksOf wsize = classifyChunksBy wsize False
22132212-- option set to 'False'.
22142213--
22152214-- @
2216−-- classifySessionsOf interval pred = classifySessionsBy 1 interval False pred
2215+-- classifySessionsOf = classifySessionsBy 1 False
22172216-- @
22182217--
22192218-- /Pre-release/
@@ -2221,13 +2220,12 @@ classifyChunksOf wsize = classifyChunksBy wsize False
22212220{-# INLINABLE classifySessionsOf #-}
22222221classifySessionsOf ::
22232222 (IsStream t, MonadAsync m, Ord k)
2224− => Double -- ^ time window size
2225− -> (Int -> m Bool) -- ^ predicate to eject sessions on session count
2223+ => (Int -> m Bool) -- ^ predicate to eject sessions on session count
2224+ -> Double -- ^ time window size
22262225 -> Fold m a b -- ^ Fold to be applied to session events
22272226 -> t m (k, a, AbsTime) -- ^ session key, data, timestamp
22282227 -> t m (k, b)
2229−classifySessionsOf interval =
2230− classifySessionsBy 1 interval False
2228+classifySessionsOf = classifySessionsBy 1 False
22312229
22322230------------------------------------------------------------------------------
22332231-- Nested Split