@@ -32,7 +32,7 @@ module Streamly.Streams.SVar
3232 , maxThreads
3333 , maxBuffer
3434 , maxYields
35− , yieldRate
35+ , rate
3636 )
3737where
3838
@@ -198,13 +198,13 @@ maxBufferSerial _ = id
198198-- * The maximum rate that the stream consumer can achieve
199199--
200200-- @since 0.5.0
201−{-# INLINE_NORMAL yieldRate #-}
202−yieldRate :: IsStream t => Double -> t m a -> t m a
203−yieldRate n m = fromStream $ Stream $ \st stp sng yld -> do
201+{-# INLINE_NORMAL rate #-}
202+rate :: IsStream t => Double -> t m a -> t m a
203+rate n m = fromStream $ Stream $ \st stp sng yld -> do
204204 unStream (toStream m) (setMaxStreamRate n st) stp sng yld
205205
206206{-
207−{-# RULES "yieldRate serial" yieldRate = yieldRateSerial #-}
207+{-# RULES "rate serial" rate = yieldRateSerial #-}
208208yieldRateSerial :: Double -> SerialT m a -> SerialT m a
209209yieldRateSerial _ = id
210210-}
@@ -212,7 +212,7 @@ yieldRateSerial _ = id
212212-- | Specify the average latency, in nanoseconds, of a single threaded action
213213-- in a concurrent composition. Streamly can measure the latencies, but that is
214214-- possible only after at least one task has completed. This combinator can be
215−-- used to provide a latency hint so that rate control using 'yieldRate' can take
215+-- used to provide a latency hint so that rate control using 'rate' can take
216216-- that into account right from the beginning. When not specified then a
217217-- default behavior is chosen which could be too slow or too fast, and would be
218218-- restricted by any other control parameters configured.