Constructors
TopkInfotopkInfoK :: IntegerNumber of items kept in the Top-K list.
topkInfoWidth :: IntegerNumber of counters in each array.
topkInfoDepth :: IntegerNumber of counter arrays.
topkInfoDecay :: DoubleDecay factor of the sketch.
:: a typeCtrl KGHC 9.14.1 · lts/ghc-9.14.x · 45dd537 · 2026-10-11
Modulehedis-0.16.4Haskell2010
TopkInfotopkInfoK :: IntegerNumber of items kept in the Top-K list.
topkInfoWidth :: IntegerNumber of counters in each array.
topkInfoDepth :: IntegerNumber of counter arrays.
topkInfoDecay :: DoubleDecay factor of the sketch.
topkAdd :: RedisCtx m f=> ByteStringKey of the Top-K sketch.
-> NonEmpty ByteStringItems to add.
-> m (f [Maybe ByteString])Adds one or more items to a Top-K sketch (https://redis.io/commands/topk.add).
Returns the items dropped from the sketch after each insertion, or Nothing when no item was expelled.
O(n cdot d), where n is the number of items and d is the depth of the sketch.
Since RedisBloom 2.0.0
topkCount :: RedisCtx m f=> ByteStringKey of the Top-K sketch.
-> NonEmpty ByteStringItems to count.
-> m (f [Integer])Returns the count for one or more items in a Top-K sketch (https://redis.io/commands/topk.count).
Returns 0 for items that are not tracked by the sketch.
O(n cdot d), where n is the number of items and d is the depth of the sketch.
Since RedisBloom 2.0.0
topkIncrby :: RedisCtx m f=> ByteStringKey of the Top-K sketch.
-> NonEmpty (ByteString, Integer)Item and increment pairs.
-> m (f [Maybe ByteString])Increments the count of one or more items by a configured amount (https://redis.io/commands/topk.incrby).
Returns the items dropped from the sketch after each increment, or Nothing when no item was expelled.
O(n cdot d), where n is the number of item-increment pairs and d is the depth of the sketch.
Since RedisBloom 2.0.0
Since RedisBloom 2.0.0
Returns the items in a Top-K sketch (https://redis.io/commands/topk.list).
O(k), where k is the configured top-k size.
Since RedisBloom 2.0.0
topkListWithCount :: RedisCtx m f=> ByteStringKey of the Top-K sketch.
-> m (f [(ByteString, Integer)])Returns the items in a Top-K sketch along with their approximated counts (https://redis.io/commands/topk.list).
O(k), where k is the configured top-k size.
Since RedisBloom 2.0.0
topkReserve Creates an empty Top-K sketch (https://redis.io/commands/topk.reserve).
The sketch will fail to be created if the key already exists.
O(1)
Since RedisBloom 2.0.0
topkQuery :: RedisCtx m f=> ByteStringKey of the Top-K sketch.
-> NonEmpty ByteStringItems to check.
-> m (f [Bool])Checks whether one or more items are present in a Top-K sketch (https://redis.io/commands/topk.query).
A False value means the item is not currently one of the tracked heavy hitters.
O(n cdot d), where n is the number of items and d is the depth of the sketch.
Since RedisBloom 2.0.0