Safe Haskell | None |
---|---|
Language | Haskell2010 |
Important: it is required that the Hashable and Eq instances used for HashSet respect whatever is used for serialization, since Redis will decide equality only on serialized values.
Synopsis
- smembers :: (MonadRedis m, Eq b, Hashable b) => RedisSet a b -> a -> m (HashSet b)
- sismember :: MonadRedis m => RedisSet a b -> a -> b -> m Bool
- sadd :: (MonadRedis m, Traversable t) => RedisSet a b -> a -> t b -> m ()
- srem :: (MonadRedis m, Traversable t) => RedisSet a b -> a -> t b -> m ()
- scard :: MonadRedis m => RedisSet a b -> a -> m Integer
- srandmember :: MonadRedis m => RedisSet a b -> a -> m (Maybe b)
- srandmemberN :: MonadRedis m => RedisSet a b -> Integer -> a -> m [b]
- sscan :: MonadRedis m => RedisSet a b -> a -> Cursor -> m (Maybe Cursor, [b])
Documentation
smembers :: (MonadRedis m, Eq b, Hashable b) => RedisSet a b -> a -> m (HashSet b) Source #
Retrieve the elements of a set from Redis
sismember :: MonadRedis m => RedisSet a b -> a -> b -> m Bool Source #
Test if an item is a member of a set
sadd :: (MonadRedis m, Traversable t) => RedisSet a b -> a -> t b -> m () Source #
Add items to a set
srem :: (MonadRedis m, Traversable t) => RedisSet a b -> a -> t b -> m () Source #
Remove items from a set
srandmember :: MonadRedis m => RedisSet a b -> a -> m (Maybe b) Source #
Retrieve a random element from a set. The underlying Redis primitive uses a poor but efficient distribution, biased by the underlying hash bucket allocation.
srandmemberN :: MonadRedis m => RedisSet a b -> Integer -> a -> m [b] Source #
Retrieve up to N unique random elements, limited by the cardinality of the set.