@@ -32,7 +32,7 @@ module Streamly.Streams.SVar
32 , maxThreads
32 , maxThreads
33 , maxBuffer
33 , maxBuffer
34 , maxYields
34 , maxYields
35− , yieldRate
35+ , rate
@@ -198,13 +198,13 @@ maxBufferSerial _ = id
198-- * The maximum rate that the stream consumer can achieve
198-- * The maximum rate that the stream consumer can achieve
200-- @since 0.5.0
200-- @since 0.5.0
201−{-# INLINE_NORMAL yieldRate #-}
201+{-# INLINE_NORMAL rate #-}
202−yieldRate :: IsStream t => Double -> t m a -> t m a
202+rate :: IsStream t => Double -> t m a -> t m a
203−yieldRate n m = fromStream $ Stream $ \st stp sng yld -> do
203+rate n m = fromStream $ Stream $ \st stp sng yld -> do
204 unStream (toStream m) (setMaxStreamRate n st) stp sng yld
204 unStream (toStream m) (setMaxStreamRate n st) stp sng yld
207−{-# RULES "yieldRate serial" yieldRate = yieldRateSerial #-}
207+{-# RULES "rate serial" rate = yieldRateSerial #-}
208yieldRateSerial :: Double -> SerialT m a -> SerialT m a
208yieldRateSerial :: Double -> SerialT m a -> SerialT m a
209yieldRateSerial _ = id
209yieldRateSerial _ = id
@@ -212,7 +212,7 @@ yieldRateSerial _ = id
212-- | Specify the average latency, in nanoseconds, of a single threaded action
212-- | Specify the average latency, in nanoseconds, of a single threaded action
213-- in a concurrent composition. Streamly can measure the latencies, but that is
213-- in a concurrent composition. Streamly can measure the latencies, but that is
214-- possible only after at least one task has completed. This combinator can be
214-- 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
216-- that into account right from the beginning. When not specified then a
216-- that into account right from the beginning. When not specified then a
217-- default behavior is chosen which could be too slow or too fast, and would be
217-- default behavior is chosen which could be too slow or too fast, and would be
218-- restricted by any other control parameters configured.
218-- restricted by any other control parameters configured.