Database.Redis.Monad

redis-0.13: A driver for Redis key-value database

Safe Haskell | None

Database.Redis.Monad

Contents

- Types ans Constructors
- Database connection
- Redis commands
  - Generic
  - Strings
  - Lists
  - Sets
  - Sorted sets
  - Hashes
  - Sorting
  - Publish/Subscribe
  - Persistent control

Description

Monadic wrapper for Database.Redis.Redis

Synopsis

- class MonadIO m => WithRedis m where
  - getRedis :: m Redis
  - setRedis :: Redis -> m ()
- data Redis = Redis {
  - r_lock :: RLock
  - r_st :: IORef RedisState
  }
- data Reply s
  - = RTimeout
  - | RParseError String
  - | ROk
  - | RPong
  - | RQueued
  - | RError String
  - | RInline s
  - | RInt Int
  - | RBulk (Maybe s)
  - | RMulti (Maybe [Reply s])
- data Message s
  - = MSubscribe s Int
  - | MUnsubscribe s Int
  - | MPSubscribe s Int
  - | MPUnsubscribe s Int
  - | MMessage s s
  - | MPMessage s s s
- data LInsertDirection
  - = BEFORE
  - | AFTER
- data Interval a
  - = Closed a a
  - | Open a a
  - | LeftOpen a a
  - | RightOpen a a
- class IsInterval i a | i -> a where
  - toInterval :: i -> Interval a
- data SortOptions s = SortOptions {
  - desc :: Bool
  - limit :: (Int, Int)
  - alpha :: Bool
  - sort_by :: s
  - get_obj :: [s]
  - store :: s
  }
- data Aggregate
  - = SUM
  - | MIN
  - | MAX
- data RedisKeyType
- type RedisInfo = Map String String
- sortDefaults :: SortOptions ByteString
- fromRInline :: (Monad m, BS s) => Reply s -> m s
- fromRBulk :: (Monad m, BS s) => Reply s -> m (Maybe s)
- fromRMulti :: (Monad m, BS s) => Reply s -> m (Maybe [Reply s])
- fromRMultiBulk :: (Monad m, BS s) => Reply s -> m (Maybe [Maybe s])
- fromRMultiBulk' :: (Monad m, BS s) => Reply s -> m [s]
- fromRInt :: (Monad m, BS s) => Reply s -> m Int
- fromROk :: (Monad m, BS s) => Reply s -> m ()
- noError :: (Monad m, BS s) => Reply s -> m ()
- parseMessage :: (Monad m, BS s) => Reply ByteString -> m (Message s)
- takeAll :: (Int, Int)
- localhost :: String
- defaultPort :: String
- connect :: WithRedis m => String -> String -> m ()
- disconnect :: WithRedis m => m ()
- isConnected :: WithRedis m => m Bool
- getServer :: WithRedis m => m (String, String)
- getDatabase :: WithRedis m => m Int
- renameCommand :: WithRedis m => ByteString -> ByteString -> m ()
- ping :: WithRedis m => m (Reply ())
- auth :: WithRedis m => String -> m (Reply ())
- echo :: (WithRedis m, BS s) => s -> m (Reply s)
- quit :: WithRedis m => m ()
- shutdown :: WithRedis m => m ()
- multi :: WithRedis m => m (Reply ())
- exec :: (WithRedis m, BS s) => m (Reply s)
- discard :: WithRedis m => m (Reply ())
- run_multi :: (MonadCatchIO m, WithRedis m, BS s) => m () -> m (Reply s)
- watch :: (WithRedis m, BS s) => [s] -> m (Reply ())
- unwatch :: WithRedis m => m (Reply ())
- run_cas :: (MonadCatchIO m, WithRedis m, BS s1) => [s1] -> m a -> m a
- exists :: (WithRedis m, BS s) => s -> m (Reply Int)
- del :: (WithRedis m, BS s) => s -> m (Reply Int)
- del_ :: (WithRedis m, BS s) => [s] -> m (Reply Int)
- getType :: (WithRedis m, BS s1) => s1 -> m RedisKeyType
- keys :: (WithRedis m, BS s1, BS s2) => s1 -> m (Reply s2)
- randomKey :: (WithRedis m, BS s) => m (Reply s)
- rename :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> m (Reply ())
- renameNx :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> m (Reply Int)
- dbsize :: WithRedis m => m (Reply Int)
- expire :: (WithRedis m, BS s) => s -> Int -> m (Reply Int)
- expireAt :: (WithRedis m, BS s) => s -> Int -> m (Reply Int)
- persist :: (WithRedis m, BS s) => s -> m (Reply Int)
- ttl :: (WithRedis m, BS s) => s -> m (Reply Int)
- select :: WithRedis m => Int -> m (Reply ())
- move :: (WithRedis m, BS s) => s -> Int -> m (Reply Int)
- flushDb :: WithRedis m => m (Reply ())
- flushAll :: WithRedis m => m (Reply ())
- info :: WithRedis m => m RedisInfo
- set :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> m (Reply ())
- setNx :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> m (Reply Int)
- setEx :: (WithRedis m, BS s1, BS s2) => s1 -> Int -> s2 -> m (Reply ())
- mSet :: (WithRedis m, BS s1, BS s2) => [(s1, s2)] -> m (Reply ())
- mSetNx :: (WithRedis m, BS s1, BS s2) => [(s1, s2)] -> m (Reply Int)
- get :: (WithRedis m, BS s1, BS s2) => s1 -> m (Reply s2)
- getSet :: (WithRedis m, BS s1, BS s2, BS s3) => s1 -> s2 -> m (Reply s3)
- mGet :: (WithRedis m, BS s1, BS s2) => [s1] -> m (Reply s2)
- incr :: (WithRedis m, BS s) => s -> m (Reply Int)
- incrBy :: (WithRedis m, BS s) => s -> Int -> m (Reply Int)
- incrByFloat :: (WithRedis m, BS s) => s -> Double -> m (Reply Double)
- decr :: (WithRedis m, BS s) => s -> m (Reply Int)
- decrBy :: (WithRedis m, BS s) => s -> Int -> m (Reply Int)
- append :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> m (Reply Int)
- substr :: (WithRedis m, BS s1, BS s2) => s1 -> (Int, Int) -> m (Reply s2)
- getrange :: (WithRedis m, BS s1, BS s2) => s1 -> (Int, Int) -> m (Reply s2)
- setrange :: (WithRedis m, BS s1, BS s2) => s1 -> Int -> s2 -> m (Reply Int)
- getbit :: (WithRedis m, BS s) => s -> Int -> m (Reply Int)
- setbit :: (WithRedis m, BS s) => s -> Int -> Int -> m (Reply Int)
- strlen :: (WithRedis m, BS s) => s -> m (Reply Int)
- rpush :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> m (Reply Int)
- rpush_ :: (WithRedis m, BS s1, BS s2) => s1 -> [s2] -> m (Reply Int)
- lpush :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> m (Reply Int)
- rpushx :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> m (Reply Int)
- lpushx :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> m (Reply Int)
- llen :: (WithRedis m, BS s) => s -> m (Reply Int)
- lrange :: (WithRedis m, BS s1, BS s2) => s1 -> (Int, Int) -> m (Reply s2)
- ltrim :: (WithRedis m, BS s) => s -> (Int, Int) -> m (Reply ())
- lindex :: (WithRedis m, BS s1, BS s2) => s1 -> Int -> m (Reply s2)
- lset :: (WithRedis m, BS s1, BS s2) => s1 -> Int -> s2 -> m (Reply ())
- lrem :: (WithRedis m, BS s1, BS s2) => s1 -> Int -> s2 -> m (Reply Int)
- lpop :: (WithRedis m, BS s1, BS s2) => s1 -> m (Reply s2)
- rpop :: (WithRedis m, BS s1, BS s2) => s1 -> m (Reply s2)
- rpoplpush :: (WithRedis m, BS s1, BS s2, BS s3) => s1 -> s2 -> m (Reply s3)
- blpop :: (WithRedis m, BS s1, BS s2) => [s1] -> Int -> m (Maybe (s1, s2))
- brpop :: (WithRedis m, BS s1, BS s2) => [s1] -> Int -> m (Maybe (s1, s2))
- brpoplpush :: (WithRedis m, BS s1, BS s2, BS s3) => s1 -> s2 -> Int -> m (Maybe (Maybe s3))
- sadd :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> m (Reply Int)
- sadd_ :: (WithRedis m, BS s1, BS s2) => s1 -> [s2] -> m (Reply Int)
- srem :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> m (Reply Int)
- srem_ :: (WithRedis m, BS s1, BS s2) => s1 -> [s2] -> m (Reply Int)
- spop :: (WithRedis m, BS s1, BS s2) => s1 -> m (Reply s2)
- smove :: (WithRedis m, BS s1, BS s2, BS s3) => s1 -> s2 -> s3 -> m (Reply Int)
- scard :: (WithRedis m, BS s) => s -> m (Reply Int)
- sismember :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> m (Reply Int)
- smembers :: (WithRedis m, BS s1, BS s2) => s1 -> m (Reply s2)
- srandmember :: (WithRedis m, BS s1, BS s2) => s1 -> m (Reply s2)
- sinter :: (WithRedis m, BS s1, BS s2) => [s1] -> m (Reply s2)
- sinterStore :: (WithRedis m, BS s1, BS s2) => s1 -> [s2] -> m (Reply ())
- sunion :: (WithRedis m, BS s1, BS s2) => [s1] -> m (Reply s2)
- sunionStore :: (WithRedis m, BS s1, BS s2) => s1 -> [s2] -> m (Reply ())
- sdiff :: (WithRedis m, BS s1, BS s2) => [s1] -> m (Reply s2)
- sdiffStore :: (WithRedis m, BS s1, BS s2) => s1 -> [s2] -> m (Reply ())
- zadd :: (WithRedis m, BS s1, BS s2) => s1 -> Double -> s2 -> m (Reply Int)
- zadd_ :: (WithRedis m, BS s1, BS s2) => s1 -> [(Double, s2)] -> m (Reply Int)
- zrem :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> m (Reply Int)
- zrem_ :: (WithRedis m, BS s1, BS s2) => s1 -> [s2] -> m (Reply Int)
- zincrBy :: (WithRedis m, BS s1, BS s2, BS s3) => s1 -> Double -> s2 -> m (Reply s3)
- zrange :: (WithRedis m, BS s1, BS s2) => s1 -> (Int, Int) -> Bool -> m (Reply s2)
- zrevrange :: (WithRedis m, BS s1, BS s2) => s1 -> (Int, Int) -> Bool -> m (Reply s2)
- zrangebyscore :: (WithRedis m, IsInterval i Double, BS s1, BS s2) => s1 -> i -> Maybe (Int, Int) -> Bool -> m (Reply s2)
- zrevrangebyscore :: (WithRedis m, IsInterval i Double, BS s1, BS s2) => s1 -> i -> Maybe (Int, Int) -> Bool -> m (Reply s2)
- zcount :: (WithRedis m, IsInterval i Double, BS s) => s -> i -> m (Reply Int)
- zremrangebyscore :: (WithRedis m, BS s) => s -> (Double, Double) -> m (Reply Int)
- zcard :: (WithRedis m, BS s) => s -> m (Reply Int)
- zscore :: (WithRedis m, BS s1, BS s2, BS s3) => s1 -> s2 -> m (Reply s3)
- zrank :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> m (Reply Int)
- zrevrank :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> m (Reply Int)
- zremrangebyrank :: (WithRedis m, BS s) => s -> (Int, Int) -> m (Reply Int)
- zunion :: (WithRedis m, BS s1, BS s2) => s1 -> [s2] -> [Double] -> Aggregate -> m (Reply Int)
- zinter :: (WithRedis m, BS s1, BS s2) => s1 -> [s2] -> [Double] -> Aggregate -> m (Reply Int)
- zunionStore :: (WithRedis m, BS s1, BS s2) => s1 -> [s2] -> [Double] -> Aggregate -> m (Reply Int)
- zinterStore :: (WithRedis m, BS s1, BS s2) => s1 -> [s2] -> [Double] -> Aggregate -> m (Reply Int)
- hset :: (WithRedis m, BS s1, BS s2, BS s3) => s1 -> s2 -> s3 -> m (Reply Int)
- hget :: (WithRedis m, BS s1, BS s2, BS s3) => s1 -> s2 -> m (Reply s3)
- hdel :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> m (Reply Int)
- hdel_ :: (WithRedis m, BS s1, BS s2) => s1 -> [s2] -> m (Reply Int)
- hmset :: (WithRedis m, BS s1, BS s2, BS s3) => s1 -> [(s2, s3)] -> m (Reply ())
- hmget :: (WithRedis m, BS s1, BS s2, BS s3) => s1 -> [s2] -> m (Reply s3)
- hincrBy :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> Int -> m (Reply Int)
- hincrByFloat :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> Double -> m (Reply Double)
- hexists :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> m (Reply Int)
- hlen :: (WithRedis m, BS s) => s -> m (Reply Int)
- hkeys :: (WithRedis m, BS s1, BS s2) => s1 -> m (Reply s2)
- hvals :: (WithRedis m, BS s1, BS s2) => s1 -> m (Reply s2)
- hgetall :: (WithRedis m, BS s1, BS s2) => s1 -> m (Reply s2)
- sort :: (WithRedis m, BS s1, BS s2, BS s3) => s1 -> SortOptions s2 -> m (Reply s3)
- listRelated :: (WithRedis m, BS s1, BS s2, BS s3) => s1 -> s2 -> (Int, Int) -> m (Reply s3)
- subscribed :: WithRedis m => m Int
- subscribe :: (WithRedis m, BS s1, BS s2) => [s1] -> m [Message s2]
- unsubscribe :: (WithRedis m, BS s1, BS s2) => [s1] -> m [Message s2]
- psubscribe :: (WithRedis m, BS s1, BS s2) => [s1] -> m [Message s2]
- punsubscribe :: (WithRedis m, BS s1, BS s2) => [s1] -> m [Message s2]
- publish :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> m (Reply Int)
- listen :: (WithRedis m, BS s) => Int -> m (Maybe (Message s))
- save :: WithRedis m => m (Reply ())
- bgsave :: WithRedis m => m (Reply ())
- lastsave :: WithRedis m => m (Reply Int)
- bgrewriteaof :: WithRedis m => m (Reply ())

# Types ans Constructors

class MonadIO m => WithRedis m where

Methods

getRedis :: m Redis

setRedis :: Redis -> m ()

Instances

WithRedis RedisM |

data Redis

Redis connection descriptor

Constructors

Redis |
Fields r_lock :: RLock r_st :: IORef RedisState

Instances

Eq Redis |
WithRedis RedisM |

data Reply s

Redis reply variants

Constructors

RTimeout | Timeout. Currently unused
RParseError String | Error converting value from ByteString. It's a client-side error.
ROk | "Ok" reply
RPong | Reply for the ping command
RQueued | Used inside multi-exec block
RError String | Some kind of server-side error
RInline s | Simple oneline reply
RInt Int | Integer reply
RBulk (Maybe s) | Multiline reply
RMulti (Maybe [Reply s]) | Complex reply. It may consists of various type of replys

Instances

Eq s => Eq (Reply s) |
BS s => Show (Reply s) |

data Message s

Constructors

MSubscribe s Int | subscribed
MUnsubscribe s Int | unsubscribed
MPSubscribe s Int | pattern subscribed
MPUnsubscribe s Int | pattern unsubscribed
MMessage s s | message recieved
MPMessage s s s | message recieved by pattern

Instances

Eq s => Eq (Message s) |
Show s => Show (Message s) |

data LInsertDirection

Constructors

BEFORE |
AFTER |

Instances

Show LInsertDirection |

data Interval a

Interval representation

Constructors

Closed a a | closed interval [a, b]
Open a a | open interval (a, b)
LeftOpen a a | left-open interval (a, b]
RightOpen a a | right-open interval [a, b)

Instances

Show a => Show (Interval a) |
IsInterval (Interval a) a | Trivial IsInterval instance

class IsInterval i a | i -> a where

Class for conversion value to `Interval`

Definied instances is:

- the Interval itself
- pair (a,b) for open interval
- two-member list [a, b] for closed interval (throws runtime error if the list length is different)

Methods

toInterval :: i -> Interval a

Instances

IsInterval [a] a | Two-element list [a, b] converted to closed interval. No static checking of list length performed.
IsInterval (Interval a) a | Trivial IsInterval instance
IsInterval (a, a) a | Pair (a, b) converted to open interval

data SortOptions s

Options data type for the `sort` command

Constructors

SortOptions |
Fields desc :: Bool sort with descending order limit :: (Int, Int) return (from, to) elements alpha :: Bool sort alphabetically sort_by :: s sort by value from this key get_obj :: [s] return this keys values store :: s store result to this key

data Aggregate

Constructors

SUM |
MIN |
MAX |

Instances

Eq Aggregate |
Show Aggregate |

data RedisKeyType

Instances

Eq RedisKeyType |
Show RedisKeyType |

type RedisInfo = Map String String

sortDefaults :: SortOptions ByteString

Default options for the `sort` command

fromRInline :: (Monad m, BS s) => Reply s -> m s

Unwraps RInline reply.

Throws an exception when called with something different from RInline

fromRBulk :: (Monad m, BS s) => Reply s -> m (Maybe s)

Unwraps RBulk reply.

Throws an exception when called with something different from RBulk

fromRMulti :: (Monad m, BS s) => Reply s -> m (Maybe [Reply s])

Unwraps RMulti reply

Throws an exception when called with something different from RMulti

fromRMultiBulk :: (Monad m, BS s) => Reply s -> m (Maybe [Maybe s])

Unwraps RMulti reply filled with RBulk

Throws an exception when called with something different from RMulti

fromRMultiBulk' :: (Monad m, BS s) => Reply s -> m [s]

The same as fromRMultiBulk but with fromJust applied

fromRInt :: (Monad m, BS s) => Reply s -> m Int

Unwraps RInt reply

Throws an exception when called with something different from RInt

fromROk :: (Monad m, BS s) => Reply s -> m ()

Unwraps ROk reply

Throws an exception when called with something different from ROk

noError :: (Monad m, BS s) => Reply s -> m ()

Unwraps every non-error reply

Throws an exception when called with something different from RMulti

parseMessage :: (Monad m, BS s) => Reply ByteString -> m (Message s)

Parse Reply as a Message

Throws an exception on parse error

takeAll :: (Int, Int)

a (0, -1) range - takes all element from a list in lrange, zrange and so on

# Database connection

localhost :: String

just a localhost

defaultPort :: String

default Redis port

connect :: WithRedis m => String -> String -> m ()

disconnect :: WithRedis m => m ()

isConnected :: WithRedis m => m Bool

getServer :: WithRedis m => m (String, String)

getDatabase :: WithRedis m => m Int

renameCommand :: WithRedis m => ByteString -> ByteString -> m ()

# Redis commands

## Generic

ping :: WithRedis m => m (Reply ())

auth :: WithRedis m => String -> m (Reply ())

echo :: (WithRedis m, BS s) => s -> m (Reply s)

quit :: WithRedis m => m ()

shutdown :: WithRedis m => m ()

multi :: WithRedis m => m (Reply ())

exec :: (WithRedis m, BS s) => m (Reply s)

discard :: WithRedis m => m (Reply ())

run_multi :: (MonadCatchIO m, WithRedis m, BS s) => m () -> m (Reply s)

watch :: (WithRedis m, BS s) => [s] -> m (Reply ())

unwatch :: WithRedis m => m (Reply ())

run_cas :: (MonadCatchIO m, WithRedis m, BS s1) => [s1] -> m a -> m a

exists :: (WithRedis m, BS s) => s -> m (Reply Int)

del :: (WithRedis m, BS s) => s -> m (Reply Int)

del_ :: (WithRedis m, BS s) => [s] -> m (Reply Int)

getType :: (WithRedis m, BS s1) => s1 -> m RedisKeyType

keys :: (WithRedis m, BS s1, BS s2) => s1 -> m (Reply s2)

randomKey :: (WithRedis m, BS s) => m (Reply s)

rename :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> m (Reply ())

renameNx :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> m (Reply Int)

dbsize :: WithRedis m => m (Reply Int)

expire :: (WithRedis m, BS s) => s -> Int -> m (Reply Int)

expireAt :: (WithRedis m, BS s) => s -> Int -> m (Reply Int)

persist :: (WithRedis m, BS s) => s -> m (Reply Int)

ttl :: (WithRedis m, BS s) => s -> m (Reply Int)

select :: WithRedis m => Int -> m (Reply ())

move :: (WithRedis m, BS s) => s -> Int -> m (Reply Int)

flushDb :: WithRedis m => m (Reply ())

flushAll :: WithRedis m => m (Reply ())

info :: WithRedis m => m RedisInfo

## Strings

set :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> m (Reply ())

setNx :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> m (Reply Int)

setEx :: (WithRedis m, BS s1, BS s2) => s1 -> Int -> s2 -> m (Reply ())

mSet :: (WithRedis m, BS s1, BS s2) => [(s1, s2)] -> m (Reply ())

mSetNx :: (WithRedis m, BS s1, BS s2) => [(s1, s2)] -> m (Reply Int)

get :: (WithRedis m, BS s1, BS s2) => s1 -> m (Reply s2)

getSet :: (WithRedis m, BS s1, BS s2, BS s3) => s1 -> s2 -> m (Reply s3)

mGet :: (WithRedis m, BS s1, BS s2) => [s1] -> m (Reply s2)

incr :: (WithRedis m, BS s) => s -> m (Reply Int)

incrBy :: (WithRedis m, BS s) => s -> Int -> m (Reply Int)

incrByFloat :: (WithRedis m, BS s) => s -> Double -> m (Reply Double)

decr :: (WithRedis m, BS s) => s -> m (Reply Int)

decrBy :: (WithRedis m, BS s) => s -> Int -> m (Reply Int)

append :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> m (Reply Int)

substr :: (WithRedis m, BS s1, BS s2) => s1 -> (Int, Int) -> m (Reply s2)

getrange :: (WithRedis m, BS s1, BS s2) => s1 -> (Int, Int) -> m (Reply s2)

setrange :: (WithRedis m, BS s1, BS s2) => s1 -> Int -> s2 -> m (Reply Int)

getbit :: (WithRedis m, BS s) => s -> Int -> m (Reply Int)

setbit :: (WithRedis m, BS s) => s -> Int -> Int -> m (Reply Int)

strlen :: (WithRedis m, BS s) => s -> m (Reply Int)

## Lists

rpush :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> m (Reply Int)

rpush_ :: (WithRedis m, BS s1, BS s2) => s1 -> [s2] -> m (Reply Int)

lpush :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> m (Reply Int)

rpushx :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> m (Reply Int)

lpushx :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> m (Reply Int)

llen :: (WithRedis m, BS s) => s -> m (Reply Int)

lrange :: (WithRedis m, BS s1, BS s2) => s1 -> (Int, Int) -> m (Reply s2)

ltrim :: (WithRedis m, BS s) => s -> (Int, Int) -> m (Reply ())

lindex :: (WithRedis m, BS s1, BS s2) => s1 -> Int -> m (Reply s2)

lset :: (WithRedis m, BS s1, BS s2) => s1 -> Int -> s2 -> m (Reply ())

lrem :: (WithRedis m, BS s1, BS s2) => s1 -> Int -> s2 -> m (Reply Int)

lpop :: (WithRedis m, BS s1, BS s2) => s1 -> m (Reply s2)

rpop :: (WithRedis m, BS s1, BS s2) => s1 -> m (Reply s2)

rpoplpush :: (WithRedis m, BS s1, BS s2, BS s3) => s1 -> s2 -> m (Reply s3)

blpop :: (WithRedis m, BS s1, BS s2) => [s1] -> Int -> m (Maybe (s1, s2))

brpop :: (WithRedis m, BS s1, BS s2) => [s1] -> Int -> m (Maybe (s1, s2))

brpoplpush :: (WithRedis m, BS s1, BS s2, BS s3) => s1 -> s2 -> Int -> m (Maybe (Maybe s3))

## Sets

sadd :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> m (Reply Int)

sadd_ :: (WithRedis m, BS s1, BS s2) => s1 -> [s2] -> m (Reply Int)

srem :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> m (Reply Int)

srem_ :: (WithRedis m, BS s1, BS s2) => s1 -> [s2] -> m (Reply Int)

spop :: (WithRedis m, BS s1, BS s2) => s1 -> m (Reply s2)

smove :: (WithRedis m, BS s1, BS s2, BS s3) => s1 -> s2 -> s3 -> m (Reply Int)

scard :: (WithRedis m, BS s) => s -> m (Reply Int)

sismember :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> m (Reply Int)

smembers :: (WithRedis m, BS s1, BS s2) => s1 -> m (Reply s2)

srandmember :: (WithRedis m, BS s1, BS s2) => s1 -> m (Reply s2)

sinter :: (WithRedis m, BS s1, BS s2) => [s1] -> m (Reply s2)

sinterStore :: (WithRedis m, BS s1, BS s2) => s1 -> [s2] -> m (Reply ())

sunion :: (WithRedis m, BS s1, BS s2) => [s1] -> m (Reply s2)

sunionStore :: (WithRedis m, BS s1, BS s2) => s1 -> [s2] -> m (Reply ())

sdiff :: (WithRedis m, BS s1, BS s2) => [s1] -> m (Reply s2)

sdiffStore :: (WithRedis m, BS s1, BS s2) => s1 -> [s2] -> m (Reply ())

## Sorted sets

zadd :: (WithRedis m, BS s1, BS s2) => s1 -> Double -> s2 -> m (Reply Int)

zadd_ :: (WithRedis m, BS s1, BS s2) => s1 -> [(Double, s2)] -> m (Reply Int)

zrem :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> m (Reply Int)

zrem_ :: (WithRedis m, BS s1, BS s2) => s1 -> [s2] -> m (Reply Int)

zincrBy :: (WithRedis m, BS s1, BS s2, BS s3) => s1 -> Double -> s2 -> m (Reply s3)

zrange :: (WithRedis m, BS s1, BS s2) => s1 -> (Int, Int) -> Bool -> m (Reply s2)

zrevrange :: (WithRedis m, BS s1, BS s2) => s1 -> (Int, Int) -> Bool -> m (Reply s2)

zrangebyscore :: (WithRedis m, IsInterval i Double, BS s1, BS s2) => s1 -> i -> Maybe (Int, Int) -> Bool -> m (Reply s2)

zrevrangebyscore :: (WithRedis m, IsInterval i Double, BS s1, BS s2) => s1 -> i -> Maybe (Int, Int) -> Bool -> m (Reply s2)

zcount :: (WithRedis m, IsInterval i Double, BS s) => s -> i -> m (Reply Int)

zremrangebyscore :: (WithRedis m, BS s) => s -> (Double, Double) -> m (Reply Int)

zcard :: (WithRedis m, BS s) => s -> m (Reply Int)

zscore :: (WithRedis m, BS s1, BS s2, BS s3) => s1 -> s2 -> m (Reply s3)

zrank :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> m (Reply Int)

zrevrank :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> m (Reply Int)

zremrangebyrank :: (WithRedis m, BS s) => s -> (Int, Int) -> m (Reply Int)

zunion :: (WithRedis m, BS s1, BS s2) => s1 -> [s2] -> [Double] -> Aggregate -> m (Reply Int)

Deprecated: ZUNION command was renamed to ZUNIONSTORE

zinter :: (WithRedis m, BS s1, BS s2) => s1 -> [s2] -> [Double] -> Aggregate -> m (Reply Int)

Deprecated: ZINTER command was renamed to ZINTERSTORE

zunionStore :: (WithRedis m, BS s1, BS s2) => s1 -> [s2] -> [Double] -> Aggregate -> m (Reply Int)

zinterStore :: (WithRedis m, BS s1, BS s2) => s1 -> [s2] -> [Double] -> Aggregate -> m (Reply Int)

## Hashes

hset :: (WithRedis m, BS s1, BS s2, BS s3) => s1 -> s2 -> s3 -> m (Reply Int)

hget :: (WithRedis m, BS s1, BS s2, BS s3) => s1 -> s2 -> m (Reply s3)

hdel :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> m (Reply Int)

hdel_ :: (WithRedis m, BS s1, BS s2) => s1 -> [s2] -> m (Reply Int)

hmset :: (WithRedis m, BS s1, BS s2, BS s3) => s1 -> [(s2, s3)] -> m (Reply ())

hmget :: (WithRedis m, BS s1, BS s2, BS s3) => s1 -> [s2] -> m (Reply s3)

hincrBy :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> Int -> m (Reply Int)

hincrByFloat :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> Double -> m (Reply Double)

hexists :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> m (Reply Int)

hlen :: (WithRedis m, BS s) => s -> m (Reply Int)

hkeys :: (WithRedis m, BS s1, BS s2) => s1 -> m (Reply s2)

hvals :: (WithRedis m, BS s1, BS s2) => s1 -> m (Reply s2)

hgetall :: (WithRedis m, BS s1, BS s2) => s1 -> m (Reply s2)

## Sorting

sort :: (WithRedis m, BS s1, BS s2, BS s3) => s1 -> SortOptions s2 -> m (Reply s3)

listRelated :: (WithRedis m, BS s1, BS s2, BS s3) => s1 -> s2 -> (Int, Int) -> m (Reply s3)

## Publish/Subscribe

subscribed :: WithRedis m => m Int

subscribe :: (WithRedis m, BS s1, BS s2) => [s1] -> m [Message s2]

unsubscribe :: (WithRedis m, BS s1, BS s2) => [s1] -> m [Message s2]

psubscribe :: (WithRedis m, BS s1, BS s2) => [s1] -> m [Message s2]

punsubscribe :: (WithRedis m, BS s1, BS s2) => [s1] -> m [Message s2]

publish :: (WithRedis m, BS s1, BS s2) => s1 -> s2 -> m (Reply Int)

listen :: (WithRedis m, BS s) => Int -> m (Maybe (Message s))

## Persistent control

save :: WithRedis m => m (Reply ())

bgsave :: WithRedis m => m (Reply ())

lastsave :: WithRedis m => m (Reply Int)

bgrewriteaof :: WithRedis m => m (Reply ())