Safe Haskell | Trustworthy |
---|---|
Language | Haskell2010 |
A bloom filter for the Redis in-memory store.
- newtype HashCount = HashCount Int
- newtype Capacity = Capacity Int
- type Key = ByteString
- data Bloom a = Bloom {}
- createBF :: RedisCtx m (Either Reply) => Bloom a -> m (Either Reply Status)
- createIfNewBF :: RedisCtx m (Either Reply) => Bloom a -> m (Either Reply Bool)
- addBF :: RedisCtx m f => Bloom a -> a -> m ()
- queryBF :: (MonadRedis m, RedisCtx m (Either Reply)) => Bloom a -> a -> m Bool
- querySafeBF :: (Applicative f, MonadRedis m, RedisCtx m f) => Bloom a -> a -> m (f Bool)
Bloom filter configuration
Fundamental types
Number of hashes to use in a bloom filter.
Capacity of a bloom filter.
type Key = ByteString Source #
Redis Key
Static bloom filter configuration
Bloom filter static configuration.
To use suggested values based on the desired
false-positive rate and capacity, use suggestCreate
.
Bloom | |
|
Bloom filter operations
createBF :: RedisCtx m (Either Reply) => Bloom a -> m (Either Reply Status) Source #
Create a new bloom filter with the specified configuration.
createIfNewBF :: RedisCtx m (Either Reply) => Bloom a -> m (Either Reply Bool) Source #
Create a new bloom filter with the specified configuration if the specified key does not yet exist.
queryBF :: (MonadRedis m, RedisCtx m (Either Reply)) => Bloom a -> a -> m Bool Source #
Query whether an element exists in the bloom filter.
Gracefully fails upon failure by returning False
.
querySafeBF :: (Applicative f, MonadRedis m, RedisCtx m f) => Bloom a -> a -> m (f Bool) Source #
Query whether an element exists in the bloom filter.