Safe Haskell | None |
---|---|

Language | Haskell2010 |

- del :: KnownSymbol s => Proxy s -> Edis xs (Del xs s) (Either Reply Integer)
- dump :: ByteString -> Edis xs xs (Either Reply ByteString)
- exists :: ByteString -> Edis xs xs (Either Reply Bool)
- expire :: ByteString -> Integer -> Edis xs xs (Either Reply Bool)
- expireat :: ByteString -> Integer -> Edis xs xs (Either Reply Bool)
- keys :: ByteString -> Edis xs xs (Either Reply [ByteString])
- migrate :: ByteString -> ByteString -> ByteString -> Integer -> Integer -> Edis xs xs (Either Reply Status)
- move :: ByteString -> Integer -> Edis xs xs (Either Reply Bool)
- objectRefcount :: ByteString -> Edis xs xs (Either Reply Integer)
- objectEncoding :: ByteString -> Edis xs xs (Either Reply ByteString)
- objectIdletime :: ByteString -> Edis xs xs (Either Reply Integer)
- persist :: ByteString -> Edis xs xs (Either Reply Bool)
- pexpire :: ByteString -> Integer -> Edis xs xs (Either Reply Bool)
- pexpireat :: ByteString -> Integer -> Edis xs xs (Either Reply Bool)
- pttl :: ByteString -> Edis xs xs (Either Reply Integer)
- randomkey :: Edis xs xs (Either Reply (Maybe ByteString))
- rename :: (KnownSymbol s, KnownSymbol t, Member xs s ~ True, Get xs s ~ Just x, (s == t) ~ False) => Proxy s -> Proxy t -> Edis xs (Set (Del xs s) t x) (Either Reply Status)
- renamenx :: (KnownSymbol s, KnownSymbol t, Member xs s ~ True, Get xs s ~ Just x, (s == t) ~ False) => Proxy s -> Proxy t -> Edis xs (If (Member xs t) xs (Del xs s)) (Either Reply Bool)
- restore :: ByteString -> Integer -> ByteString -> Edis xs xs (Either Reply Status)
- sort :: (KnownSymbol s, Serialize x, Member xs s ~ True, ((Get xs s == Just (ListOf x)) || ((Get xs s == Just (SetOf x)) || (Get xs s == Just (ZSetOf x)))) ~ True) => Proxy s -> SortOpts -> Edis xs xs (Either Reply [x])
- sortStore :: (KnownSymbol s, KnownSymbol t, Member xs s ~ True, FromJust (Get xs s) ~ x, (IsList (FromJust (Get xs s)) || (IsSet (FromJust (Get xs s)) || IsZSet (FromJust (Get xs s)))) ~ True) => Proxy s -> Proxy t -> SortOpts -> Edis xs (Set xs s x) (Either Reply Integer)
- ttl :: ByteString -> Edis xs xs (Either Reply Integer)
- getType :: ByteString -> Edis xs xs (Either Reply RedisType)
- append :: (KnownSymbol s, Serialize x, StringOrNX xs s) => Proxy s -> x -> Edis xs (Set xs s (StringOf ByteString)) (Either Reply Integer)
- bitcount :: (KnownSymbol s, StringOrNX xs s) => Proxy s -> Edis xs xs (Either Reply Integer)
- bitcountRange :: (KnownSymbol s, StringOrNX xs s) => Proxy s -> Integer -> Integer -> Edis xs xs (Either Reply Integer)
- bitopAnd :: (KnownSymbol s, KnownSymbol t, StringOrNX xs s) => Proxy t -> Proxy s -> Edis xs (Set xs s (StringOf ByteString)) (Either Reply Integer)
- bitopOr :: (KnownSymbol s, KnownSymbol t, StringOrNX xs s) => Proxy t -> Proxy s -> Edis xs (Set xs s (StringOf ByteString)) (Either Reply Integer)
- bitopXor :: (KnownSymbol s, KnownSymbol t, StringOrNX xs s) => Proxy t -> Proxy s -> Edis xs (Set xs s (StringOf ByteString)) (Either Reply Integer)
- bitopNot :: (KnownSymbol s, KnownSymbol t, StringOrNX xs s) => Proxy t -> Proxy s -> Edis xs (Set xs s (StringOf ByteString)) (Either Reply Integer)
- decr :: (KnownSymbol s, StringOfIntegerOrNX xs s) => Proxy s -> Edis xs (Set xs s (StringOf Integer)) (Either Reply Integer)
- decrby :: (KnownSymbol s, StringOfIntegerOrNX xs s) => Proxy s -> Integer -> Edis xs (Set xs s (StringOf Integer)) (Either Reply Integer)
- get :: (KnownSymbol s, Serialize x, StringOf x ~ FromJust (Get xs s)) => Proxy s -> Edis xs xs (Either Reply (Maybe x))
- getbit :: (KnownSymbol s, StringOrNX xs s) => Proxy s -> Integer -> Edis xs xs (Either Reply Integer)
- getrange :: (KnownSymbol s, Serialize x, StringOf x ~ FromJust (Get xs s)) => Proxy s -> Integer -> Integer -> Edis xs xs (Either Reply x)
- getset :: (KnownSymbol s, Serialize x, Serialize y, StringOf y ~ FromJust (Get xs s)) => Proxy s -> x -> Edis xs xs (Either Reply (Maybe y))
- incr :: (KnownSymbol s, StringOfIntegerOrNX xs s) => Proxy s -> Edis xs xs (Either Reply Integer)
- incrby :: (KnownSymbol s, StringOfIntegerOrNX xs s) => Proxy s -> Integer -> Edis xs xs (Either Reply Integer)
- incrbyfloat :: (KnownSymbol s, StringOfDoubleOrNX xs s) => Proxy s -> Double -> Edis xs xs (Either Reply Double)
- psetex :: (KnownSymbol s, Serialize x) => Proxy s -> Integer -> x -> Edis xs (Set xs s (StringOf x)) (Either Reply Status)
- set :: (KnownSymbol s, Serialize x) => Proxy s -> x -> Edis xs (Set xs s (StringOf x)) (Either Reply Status)
- setbit :: (KnownSymbol s, Serialize x, StringOrNX xs s) => Proxy s -> Integer -> x -> Edis xs (Set xs s (StringOf x)) (Either Reply Integer)
- setex :: (KnownSymbol s, Serialize x) => Proxy s -> Integer -> x -> Edis xs (Set xs s (StringOf x)) (Either Reply Status)
- setnx :: (KnownSymbol s, Serialize x) => Proxy s -> x -> Edis xs (If (Member xs s) xs (Set xs s (StringOf x))) (Either Reply Bool)
- setrange :: (KnownSymbol s, Serialize x, StringOrNX xs s) => Proxy s -> Integer -> x -> Edis xs (Set xs s (StringOf x)) (Either Reply Integer)
- strlen :: (KnownSymbol s, StringOrNX xs s) => Proxy s -> Edis xs xs (Either Reply Integer)
- blpop :: (KnownSymbol s, Serialize x, ListOf x ~ FromJust (Get xs s)) => Proxy s -> Integer -> Edis xs xs (Either Reply (Maybe (ByteString, x)))
- brpop :: (KnownSymbol s, Serialize x, ListOf x ~ FromJust (Get xs s)) => Proxy s -> Integer -> Edis xs xs (Either Reply (Maybe (ByteString, x)))
- brpoplpush :: (KnownSymbol s, KnownSymbol t, Serialize x, ListOf x ~ FromJust (Get xs s), ListOrNX xs s) => Proxy s -> Proxy t -> Integer -> Edis xs (Set xs s (ListOf x)) (Either Reply (Maybe x))
- lindex :: (KnownSymbol s, Serialize x, ListOf x ~ FromJust (Get xs s)) => Proxy s -> Integer -> Edis xs xs (Either Reply (Maybe x))
- linsertBefore :: (KnownSymbol s, Serialize x, ListOrNX xs s) => Proxy s -> x -> x -> Edis xs xs (Either Reply Integer)
- linsertAfter :: (KnownSymbol s, Serialize x, ListOrNX xs s) => Proxy s -> x -> x -> Edis xs xs (Either Reply Integer)
- llen :: (KnownSymbol s, ListOrNX xs s) => Proxy s -> Edis xs xs (Either Reply Integer)
- lpop :: (KnownSymbol s, Serialize x, Just (ListOf x) ~ Get xs s) => Proxy s -> Edis xs xs (Either Reply (Maybe x))
- lpush :: (KnownSymbol s, Serialize x, ListOrNX xs s) => Proxy s -> x -> Edis xs (Set xs s (ListOf x)) (Either Reply Integer)
- lpushx :: (KnownSymbol s, Serialize x, Just (ListOf x) ~ Get xs s) => Proxy s -> x -> Edis xs xs (Either Reply Integer)
- lrange :: (KnownSymbol s, Serialize x, ListOrNX xs s) => Proxy s -> Integer -> Integer -> Edis xs xs (Either Reply [x])
- lrem :: (KnownSymbol s, Serialize x, ListOrNX xs s) => Proxy s -> Integer -> x -> Edis xs xs (Either Reply Integer)
- lset :: (KnownSymbol s, Serialize x, IsList (FromJust (Get xs s)) ~ True) => Proxy s -> Integer -> x -> Edis xs xs (Either Reply Status)
- ltrim :: (KnownSymbol s, ListOrNX xs s) => Proxy s -> Integer -> Integer -> Edis xs xs (Either Reply Status)
- rpop :: (KnownSymbol s, Serialize x, Just (ListOf x) ~ Get xs s) => Proxy s -> Edis xs xs (Either Reply (Maybe x))
- rpoplpush :: (KnownSymbol s, KnownSymbol t, Serialize x, ListOrNX xs s, ListOrNX xs t) => Proxy s -> Proxy t -> Edis xs (If (IsList (FromJust (Get xs s))) (Set xs s (ListOf x)) xs) (Either Reply (Maybe x))
- rpush :: (KnownSymbol s, Serialize x, ListOrNX xs s) => Proxy s -> x -> Edis xs (Set xs s (ListOf x)) (Either Reply Integer)
- rpushx :: (KnownSymbol s, Serialize x, Just (ListOf x) ~ Get xs s) => Proxy s -> x -> Edis xs xs (Either Reply Integer)
- hdel :: (KnownSymbol k, KnownSymbol f, HashOrNX xs k) => Proxy k -> Proxy f -> Edis xs (DelHash xs k f) (Either Reply Integer)
- hexists :: (KnownSymbol k, KnownSymbol f, HashOrNX xs k) => Proxy k -> Proxy f -> Edis xs xs (Either Reply Bool)
- hget :: (KnownSymbol k, KnownSymbol f, Serialize x, Just (StringOf x) ~ GetHash xs k f) => Proxy k -> Proxy f -> Edis xs xs (Either Reply (Maybe x))
- hincrby :: (KnownSymbol k, KnownSymbol f, HashOrNX xs k) => Proxy k -> Proxy f -> Integer -> Edis xs (SetHash xs k f Integer) (Either Reply Integer)
- hincrbyfloat :: (KnownSymbol k, KnownSymbol f, HashOrNX xs k) => Proxy k -> Proxy f -> Double -> Edis xs (SetHash xs k f Double) (Either Reply Double)
- hkeys :: (KnownSymbol k, HashOrNX xs k) => Proxy k -> Edis xs xs (Either Reply [ByteString])
- hlen :: (KnownSymbol k, HashOrNX xs k) => Proxy k -> Edis xs xs (Either Reply Integer)
- hset :: (KnownSymbol k, KnownSymbol f, Serialize x, HashOrNX xs k) => Proxy k -> Proxy f -> x -> Edis xs (SetHash xs k f (StringOf x)) (Either Reply Bool)
- hsetnx :: (KnownSymbol k, KnownSymbol f, Serialize x, HashOrNX xs k) => Proxy k -> Proxy f -> x -> Edis xs (If (MemHash xs k f) xs (SetHash xs k f (StringOf x))) (Either Reply Bool)
- sadd :: (KnownSymbol s, Serialize x, SetOrNX xs s) => Proxy s -> x -> Edis xs (If (Member xs s) xs (Set xs s (SetOf x))) (Either Reply Integer)
- scard :: (KnownSymbol s, SetOrNX xs s) => Proxy s -> Edis xs xs (Either Reply Integer)
- sdiff :: (KnownSymbol s, KnownSymbol t, Serialize x, Just (SetOf x) ~ Get xs s, SetOrNX xs s) => Proxy s -> Proxy t -> Edis xs xs (Either Reply [x])
- sdiffstore :: (KnownSymbol s, KnownSymbol t, SetOrNX xs s, SetOrNX xs t) => Proxy s -> Proxy t -> Edis xs xs (Either Reply Integer)
- sinter :: (KnownSymbol s, KnownSymbol t, Serialize x, Just (SetOf x) ~ Get xs s, SetOrNX xs s) => Proxy s -> Proxy t -> Edis xs xs (Either Reply [x])
- sinterstore :: (KnownSymbol s, KnownSymbol t, SetOrNX xs s, SetOrNX xs t) => Proxy s -> Proxy t -> Edis xs xs (Either Reply Integer)
- smembers :: (KnownSymbol s, Serialize x, Just (SetOf x) ~ Get xs s) => Proxy s -> Edis xs xs (Either Reply [x])
- smove :: (KnownSymbol s, KnownSymbol t, Serialize x, ((Not (Member xs s) && Not (IsSet (FromJust (Get xs t)))) || (SetOrNX' xs s && SetOrNX' xs t)) ~ True) => Proxy s -> Proxy t -> x -> Edis xs (Set xs t (SetOf x)) (Either Reply Bool)
- spop :: (KnownSymbol s, Serialize x, Just (SetOf x) ~ Get xs s) => Proxy s -> Edis xs xs (Either Reply (Maybe x))
- srandmember :: (KnownSymbol s, Serialize x, Just (SetOf x) ~ Get xs s) => Proxy s -> Edis xs xs (Either Reply (Maybe x))
- srem :: (KnownSymbol s, Serialize x, Just (SetOf x) ~ Get xs s) => Proxy s -> x -> Edis xs xs (Either Reply Integer)
- sunion :: (KnownSymbol s, KnownSymbol t, Serialize x, Just (SetOf x) ~ Get xs s, SetOrNX xs s) => Proxy s -> Proxy t -> Edis xs xs (Either Reply [x])
- sunionstore :: (KnownSymbol s, KnownSymbol t, SetOrNX xs s, SetOrNX xs t) => Proxy s -> Proxy t -> Edis xs xs (Either Reply Integer)
- zadd :: (KnownSymbol s, Serialize x, ZSetOrNX xs s) => Proxy s -> Double -> x -> Edis xs (If (Member xs s) xs (Set xs s (ZSetOf x))) (Either Reply Integer)
- zcard :: (KnownSymbol s, SetOrNX xs s) => Proxy s -> Edis xs xs (Either Reply Integer)
- zcount :: (KnownSymbol s, SetOrNX xs s) => Proxy s -> Double -> Double -> Edis xs xs (Either Reply Integer)
- zincrby :: (KnownSymbol s, Serialize x, ZSetOrNX xs s) => Proxy s -> Integer -> x -> Edis xs (If (Member xs s) xs (Set xs s (ZSetOf x))) (Either Reply Double)
- zrange :: (KnownSymbol s, Serialize x, Just (ZSetOf x) ~ Get xs s) => Proxy s -> Integer -> Integer -> Edis xs xs (Either Reply [x])
- zrangeWithscores :: (KnownSymbol s, Serialize x, Just (ZSetOf x) ~ Get xs s) => Proxy s -> Integer -> Integer -> Edis xs xs (Either Reply [(x, Double)])
- zrangebyscore :: (KnownSymbol s, Serialize x, Just (ZSetOf x) ~ Get xs s) => Proxy s -> Double -> Double -> Edis xs xs (Either Reply [x])
- zrangebyscoreWithscores :: (KnownSymbol s, Serialize x, Just (ZSetOf x) ~ Get xs s) => Proxy s -> Double -> Double -> Edis xs xs (Either Reply [(x, Double)])
- zrangebyscoreLimit :: (KnownSymbol s, Serialize x, Just (ZSetOf x) ~ Get xs s) => Proxy s -> Double -> Double -> Integer -> Integer -> Edis xs xs (Either Reply [x])
- zrangebyscoreWithscoresLimit :: (KnownSymbol s, Serialize x, Just (ZSetOf x) ~ Get xs s) => Proxy s -> Double -> Double -> Integer -> Integer -> Edis xs xs (Either Reply [(x, Double)])
- zrank :: (KnownSymbol s, Serialize x, Just (ZSetOf x) ~ Get xs s) => Proxy s -> x -> Edis xs xs (Either Reply (Maybe Integer))
- zremrangebyrank :: (KnownSymbol s, ZSetOrNX xs s) => Proxy s -> Integer -> Integer -> Edis xs xs (Either Reply Integer)
- zremrangebyscore :: (KnownSymbol s, ZSetOrNX xs s) => Proxy s -> Double -> Double -> Edis xs xs (Either Reply Integer)
- zrevrange :: (KnownSymbol s, Serialize x, Just (ZSetOf x) ~ Get xs s) => Proxy s -> Integer -> Integer -> Edis xs xs (Either Reply [x])
- zrevrangeWithscores :: (KnownSymbol s, Serialize x, Just (ZSetOf x) ~ Get xs s) => Proxy s -> Integer -> Integer -> Edis xs xs (Either Reply [(x, Double)])
- zrevrangebyscore :: (KnownSymbol s, Serialize x, Just (ZSetOf x) ~ Get xs s) => Proxy s -> Double -> Double -> Edis xs xs (Either Reply [x])
- zrevrangebyscoreWithscores :: (KnownSymbol s, Serialize x, Just (ZSetOf x) ~ Get xs s) => Proxy s -> Double -> Double -> Edis xs xs (Either Reply [(x, Double)])
- zrevrangebyscoreLimit :: (KnownSymbol s, Serialize x, Just (ZSetOf x) ~ Get xs s) => Proxy s -> Double -> Double -> Integer -> Integer -> Edis xs xs (Either Reply [x])
- zrevrangebyscoreWithscoresLimit :: (KnownSymbol s, Serialize x, Just (ZSetOf x) ~ Get xs s) => Proxy s -> Double -> Double -> Integer -> Integer -> Edis xs xs (Either Reply [(x, Double)])
- zrevrank :: (KnownSymbol s, Serialize x, Just (ZSetOf x) ~ Get xs s) => Proxy s -> x -> Edis xs xs (Either Reply (Maybe Integer))
- zscore :: (KnownSymbol s, Serialize x, Just (ZSetOf x) ~ Get xs s) => Proxy s -> x -> Edis xs xs (Either Reply (Maybe Double))
- bgrewriteaof :: Edis xs xs (Either Reply Status)
- bgsave :: Edis xs xs (Either Reply Status)
- configGet :: ByteString -> Edis xs xs (Either Reply [(ByteString, ByteString)])
- configResetstat :: Edis xs xs (Either Reply Status)
- configSet :: ByteString -> ByteString -> Edis xs xs (Either Reply Status)
- dbsize :: Edis xs xs (Either Reply Integer)
- debugObject :: ByteString -> Edis xs xs (Either Reply ByteString)
- flushall :: Edis xs xs (Either Reply Status)
- flushdb :: Edis xs xs (Either Reply Status)
- info :: Edis xs xs (Either Reply ByteString)
- lastsave :: Edis xs xs (Either Reply Integer)
- save :: Edis xs xs (Either Reply Status)
- slaveof :: ByteString -> ByteString -> Edis xs xs (Either Reply Status)
- slowlogGet :: Integer -> Edis xs xs (Either Reply [Slowlog])
- slowlogLen :: Edis xs xs (Either Reply Integer)
- slowlogReset :: Edis xs xs (Either Reply Status)
- time :: Edis xs xs (Either Reply (Integer, Integer))
- auth :: ByteString -> Edis xs xs (Either Reply Status)
- echo :: ByteString -> Edis xs xs (Either Reply ByteString)
- ping :: Edis xs xs (Either Reply Status)
- quit :: Edis xs xs (Either Reply Status)
- select :: Integer -> Edis xs xs (Either Reply Status)
- eval :: RedisResult a => ByteString -> [ByteString] -> [ByteString] -> Edis xs xs (Either Reply a)
- evalsha :: RedisResult a => ByteString -> [ByteString] -> [ByteString] -> Edis xs xs (Either Reply a)
- scriptExists :: [ByteString] -> Edis xs xs (Either Reply [Bool])
- scriptFlush :: Edis xs xs (Either Reply Status)
- scriptKill :: Edis xs xs (Either Reply Status)
- scriptLoad :: ByteString -> Edis xs xs (Either Reply ByteString)
- publish :: ByteString -> ByteString -> Edis xs xs (Either Reply Integer)
- pubSub :: PubSub -> (Message -> IO PubSub) -> Edis xs xs ()
- subscribe :: [ByteString] -> PubSub
- unsubscribe :: [ByteString] -> PubSub
- psubscribe :: [ByteString] -> PubSub
- punsubscribe :: [ByteString] -> PubSub
- start :: Edis '[] '[] ()
- declare :: (KnownSymbol s, Member xs s ~ False) => Proxy s -> Proxy x -> Edis xs (Set xs s x) ()
- renounce :: (KnownSymbol s, Member xs s ~ True) => Proxy s -> Edis xs (Del xs s) ()
- data Proxy k t :: forall k. k -> * = Proxy
- newtype Edis p q a = Edis {}
- class IMonad m where
- (>>>) :: IMonad m => m p q a -> m q r b -> m p r b
- data Reply :: *
- runRedis :: Connection -> Redis a -> IO a
- connect :: ConnectInfo -> IO Connection
- defaultConnectInfo :: ConnectInfo

# How to use Edis

It's basically the same as in Hedis. Most of the entities in Hedis are re-exported, or have the same names with types.

-- connects to localhost:6379 conn <-`connect`

`defaultConnectInfo`

Send commands to the server:

{-# LANGUAGE OverloadedStrings #-} ...`runRedis`

conn $`unEdis`

$`start`

'`bind`

' _ ->`set`

(`Proxy`

::`Proxy`

"hello") True '`bind`

' _ ->`set`

(`Proxy`

::`Proxy`

"world") [True, False] '`bind`

' _ ->`get`

(`Proxy`

::`Proxy`

"world")

Unfortunately `Edis`

is not a monad, so we can't use do-notations in
the program. But the example above can be rewritten with `>>>`

like
this, if no variable bindings and result passings are needed.

{-# LANGUAGE OverloadedStrings #-} ...`runRedis`

conn $`unEdis`

$`start`

`>>>`

`set`

(`Proxy`

::`Proxy`

"hello") True`>>>`

`set`

(`Proxy`

::`Proxy`

"world") [True, False]`>>>`

`get`

(`Proxy`

::`Proxy`

"world")

- Commands

## Keys

dump :: ByteString -> Edis xs xs (Either Reply ByteString) Source #

keys :: ByteString -> Edis xs xs (Either Reply [ByteString]) Source #

migrate :: ByteString -> ByteString -> ByteString -> Integer -> Integer -> Edis xs xs (Either Reply Status) Source #

objectRefcount :: ByteString -> Edis xs xs (Either Reply Integer) Source #

objectEncoding :: ByteString -> Edis xs xs (Either Reply ByteString) Source #

objectIdletime :: ByteString -> Edis xs xs (Either Reply Integer) Source #

rename :: (KnownSymbol s, KnownSymbol t, Member xs s ~ True, Get xs s ~ Just x, (s == t) ~ False) => Proxy s -> Proxy t -> Edis xs (Set (Del xs s) t x) (Either Reply Status) Source #

renamenx :: (KnownSymbol s, KnownSymbol t, Member xs s ~ True, Get xs s ~ Just x, (s == t) ~ False) => Proxy s -> Proxy t -> Edis xs (If (Member xs t) xs (Del xs s)) (Either Reply Bool) Source #

restore :: ByteString -> Integer -> ByteString -> Edis xs xs (Either Reply Status) Source #

sort :: (KnownSymbol s, Serialize x, Member xs s ~ True, ((Get xs s == Just (ListOf x)) || ((Get xs s == Just (SetOf x)) || (Get xs s == Just (ZSetOf x)))) ~ True) => Proxy s -> SortOpts -> Edis xs xs (Either Reply [x]) Source #

sortStore :: (KnownSymbol s, KnownSymbol t, Member xs s ~ True, FromJust (Get xs s) ~ x, (IsList (FromJust (Get xs s)) || (IsSet (FromJust (Get xs s)) || IsZSet (FromJust (Get xs s)))) ~ True) => Proxy s -> Proxy t -> SortOpts -> Edis xs (Set xs s x) (Either Reply Integer) Source #

## Strings

append :: (KnownSymbol s, Serialize x, StringOrNX xs s) => Proxy s -> x -> Edis xs (Set xs s (StringOf ByteString)) (Either Reply Integer) Source #

bitcount :: (KnownSymbol s, StringOrNX xs s) => Proxy s -> Edis xs xs (Either Reply Integer) Source #

bitcountRange :: (KnownSymbol s, StringOrNX xs s) => Proxy s -> Integer -> Integer -> Edis xs xs (Either Reply Integer) Source #

bitopAnd :: (KnownSymbol s, KnownSymbol t, StringOrNX xs s) => Proxy t -> Proxy s -> Edis xs (Set xs s (StringOf ByteString)) (Either Reply Integer) Source #

bitopOr :: (KnownSymbol s, KnownSymbol t, StringOrNX xs s) => Proxy t -> Proxy s -> Edis xs (Set xs s (StringOf ByteString)) (Either Reply Integer) Source #

bitopXor :: (KnownSymbol s, KnownSymbol t, StringOrNX xs s) => Proxy t -> Proxy s -> Edis xs (Set xs s (StringOf ByteString)) (Either Reply Integer) Source #

bitopNot :: (KnownSymbol s, KnownSymbol t, StringOrNX xs s) => Proxy t -> Proxy s -> Edis xs (Set xs s (StringOf ByteString)) (Either Reply Integer) Source #

decr :: (KnownSymbol s, StringOfIntegerOrNX xs s) => Proxy s -> Edis xs (Set xs s (StringOf Integer)) (Either Reply Integer) Source #

decrby :: (KnownSymbol s, StringOfIntegerOrNX xs s) => Proxy s -> Integer -> Edis xs (Set xs s (StringOf Integer)) (Either Reply Integer) Source #

get :: (KnownSymbol s, Serialize x, StringOf x ~ FromJust (Get xs s)) => Proxy s -> Edis xs xs (Either Reply (Maybe x)) Source #

getbit :: (KnownSymbol s, StringOrNX xs s) => Proxy s -> Integer -> Edis xs xs (Either Reply Integer) Source #

getrange :: (KnownSymbol s, Serialize x, StringOf x ~ FromJust (Get xs s)) => Proxy s -> Integer -> Integer -> Edis xs xs (Either Reply x) Source #

getset :: (KnownSymbol s, Serialize x, Serialize y, StringOf y ~ FromJust (Get xs s)) => Proxy s -> x -> Edis xs xs (Either Reply (Maybe y)) Source #

incr :: (KnownSymbol s, StringOfIntegerOrNX xs s) => Proxy s -> Edis xs xs (Either Reply Integer) Source #

incrby :: (KnownSymbol s, StringOfIntegerOrNX xs s) => Proxy s -> Integer -> Edis xs xs (Either Reply Integer) Source #

incrbyfloat :: (KnownSymbol s, StringOfDoubleOrNX xs s) => Proxy s -> Double -> Edis xs xs (Either Reply Double) Source #

psetex :: (KnownSymbol s, Serialize x) => Proxy s -> Integer -> x -> Edis xs (Set xs s (StringOf x)) (Either Reply Status) Source #

set :: (KnownSymbol s, Serialize x) => Proxy s -> x -> Edis xs (Set xs s (StringOf x)) (Either Reply Status) Source #

setbit :: (KnownSymbol s, Serialize x, StringOrNX xs s) => Proxy s -> Integer -> x -> Edis xs (Set xs s (StringOf x)) (Either Reply Integer) Source #

setex :: (KnownSymbol s, Serialize x) => Proxy s -> Integer -> x -> Edis xs (Set xs s (StringOf x)) (Either Reply Status) Source #

setnx :: (KnownSymbol s, Serialize x) => Proxy s -> x -> Edis xs (If (Member xs s) xs (Set xs s (StringOf x))) (Either Reply Bool) Source #

setrange :: (KnownSymbol s, Serialize x, StringOrNX xs s) => Proxy s -> Integer -> x -> Edis xs (Set xs s (StringOf x)) (Either Reply Integer) Source #

## Lists

blpop :: (KnownSymbol s, Serialize x, ListOf x ~ FromJust (Get xs s)) => Proxy s -> Integer -> Edis xs xs (Either Reply (Maybe (ByteString, x))) Source #

brpop :: (KnownSymbol s, Serialize x, ListOf x ~ FromJust (Get xs s)) => Proxy s -> Integer -> Edis xs xs (Either Reply (Maybe (ByteString, x))) Source #

brpoplpush :: (KnownSymbol s, KnownSymbol t, Serialize x, ListOf x ~ FromJust (Get xs s), ListOrNX xs s) => Proxy s -> Proxy t -> Integer -> Edis xs (Set xs s (ListOf x)) (Either Reply (Maybe x)) Source #

lindex :: (KnownSymbol s, Serialize x, ListOf x ~ FromJust (Get xs s)) => Proxy s -> Integer -> Edis xs xs (Either Reply (Maybe x)) Source #

linsertBefore :: (KnownSymbol s, Serialize x, ListOrNX xs s) => Proxy s -> x -> x -> Edis xs xs (Either Reply Integer) Source #

linsertAfter :: (KnownSymbol s, Serialize x, ListOrNX xs s) => Proxy s -> x -> x -> Edis xs xs (Either Reply Integer) Source #

lpop :: (KnownSymbol s, Serialize x, Just (ListOf x) ~ Get xs s) => Proxy s -> Edis xs xs (Either Reply (Maybe x)) Source #

lpush :: (KnownSymbol s, Serialize x, ListOrNX xs s) => Proxy s -> x -> Edis xs (Set xs s (ListOf x)) (Either Reply Integer) Source #

lpushx :: (KnownSymbol s, Serialize x, Just (ListOf x) ~ Get xs s) => Proxy s -> x -> Edis xs xs (Either Reply Integer) Source #

lrange :: (KnownSymbol s, Serialize x, ListOrNX xs s) => Proxy s -> Integer -> Integer -> Edis xs xs (Either Reply [x]) Source #

lrem :: (KnownSymbol s, Serialize x, ListOrNX xs s) => Proxy s -> Integer -> x -> Edis xs xs (Either Reply Integer) Source #

lset :: (KnownSymbol s, Serialize x, IsList (FromJust (Get xs s)) ~ True) => Proxy s -> Integer -> x -> Edis xs xs (Either Reply Status) Source #

ltrim :: (KnownSymbol s, ListOrNX xs s) => Proxy s -> Integer -> Integer -> Edis xs xs (Either Reply Status) Source #

rpop :: (KnownSymbol s, Serialize x, Just (ListOf x) ~ Get xs s) => Proxy s -> Edis xs xs (Either Reply (Maybe x)) Source #

rpoplpush :: (KnownSymbol s, KnownSymbol t, Serialize x, ListOrNX xs s, ListOrNX xs t) => Proxy s -> Proxy t -> Edis xs (If (IsList (FromJust (Get xs s))) (Set xs s (ListOf x)) xs) (Either Reply (Maybe x)) Source #

rpush :: (KnownSymbol s, Serialize x, ListOrNX xs s) => Proxy s -> x -> Edis xs (Set xs s (ListOf x)) (Either Reply Integer) Source #

rpushx :: (KnownSymbol s, Serialize x, Just (ListOf x) ~ Get xs s) => Proxy s -> x -> Edis xs xs (Either Reply Integer) Source #

## Hashes

hdel :: (KnownSymbol k, KnownSymbol f, HashOrNX xs k) => Proxy k -> Proxy f -> Edis xs (DelHash xs k f) (Either Reply Integer) Source #

hexists :: (KnownSymbol k, KnownSymbol f, HashOrNX xs k) => Proxy k -> Proxy f -> Edis xs xs (Either Reply Bool) Source #

hget :: (KnownSymbol k, KnownSymbol f, Serialize x, Just (StringOf x) ~ GetHash xs k f) => Proxy k -> Proxy f -> Edis xs xs (Either Reply (Maybe x)) Source #

hincrby :: (KnownSymbol k, KnownSymbol f, HashOrNX xs k) => Proxy k -> Proxy f -> Integer -> Edis xs (SetHash xs k f Integer) (Either Reply Integer) Source #

hincrbyfloat :: (KnownSymbol k, KnownSymbol f, HashOrNX xs k) => Proxy k -> Proxy f -> Double -> Edis xs (SetHash xs k f Double) (Either Reply Double) Source #

hkeys :: (KnownSymbol k, HashOrNX xs k) => Proxy k -> Edis xs xs (Either Reply [ByteString]) Source #

hset :: (KnownSymbol k, KnownSymbol f, Serialize x, HashOrNX xs k) => Proxy k -> Proxy f -> x -> Edis xs (SetHash xs k f (StringOf x)) (Either Reply Bool) Source #

hsetnx :: (KnownSymbol k, KnownSymbol f, Serialize x, HashOrNX xs k) => Proxy k -> Proxy f -> x -> Edis xs (If (MemHash xs k f) xs (SetHash xs k f (StringOf x))) (Either Reply Bool) Source #

## Sets

sadd :: (KnownSymbol s, Serialize x, SetOrNX xs s) => Proxy s -> x -> Edis xs (If (Member xs s) xs (Set xs s (SetOf x))) (Either Reply Integer) Source #

sdiff :: (KnownSymbol s, KnownSymbol t, Serialize x, Just (SetOf x) ~ Get xs s, SetOrNX xs s) => Proxy s -> Proxy t -> Edis xs xs (Either Reply [x]) Source #

sdiffstore :: (KnownSymbol s, KnownSymbol t, SetOrNX xs s, SetOrNX xs t) => Proxy s -> Proxy t -> Edis xs xs (Either Reply Integer) Source #

sinter :: (KnownSymbol s, KnownSymbol t, Serialize x, Just (SetOf x) ~ Get xs s, SetOrNX xs s) => Proxy s -> Proxy t -> Edis xs xs (Either Reply [x]) Source #

sinterstore :: (KnownSymbol s, KnownSymbol t, SetOrNX xs s, SetOrNX xs t) => Proxy s -> Proxy t -> Edis xs xs (Either Reply Integer) Source #

smembers :: (KnownSymbol s, Serialize x, Just (SetOf x) ~ Get xs s) => Proxy s -> Edis xs xs (Either Reply [x]) Source #

smove :: (KnownSymbol s, KnownSymbol t, Serialize x, ((Not (Member xs s) && Not (IsSet (FromJust (Get xs t)))) || (SetOrNX' xs s && SetOrNX' xs t)) ~ True) => Proxy s -> Proxy t -> x -> Edis xs (Set xs t (SetOf x)) (Either Reply Bool) Source #

spop :: (KnownSymbol s, Serialize x, Just (SetOf x) ~ Get xs s) => Proxy s -> Edis xs xs (Either Reply (Maybe x)) Source #

srandmember :: (KnownSymbol s, Serialize x, Just (SetOf x) ~ Get xs s) => Proxy s -> Edis xs xs (Either Reply (Maybe x)) Source #

srem :: (KnownSymbol s, Serialize x, Just (SetOf x) ~ Get xs s) => Proxy s -> x -> Edis xs xs (Either Reply Integer) Source #

sunion :: (KnownSymbol s, KnownSymbol t, Serialize x, Just (SetOf x) ~ Get xs s, SetOrNX xs s) => Proxy s -> Proxy t -> Edis xs xs (Either Reply [x]) Source #

sunionstore :: (KnownSymbol s, KnownSymbol t, SetOrNX xs s, SetOrNX xs t) => Proxy s -> Proxy t -> Edis xs xs (Either Reply Integer) Source #

## Sorted Sets

zadd :: (KnownSymbol s, Serialize x, ZSetOrNX xs s) => Proxy s -> Double -> x -> Edis xs (If (Member xs s) xs (Set xs s (ZSetOf x))) (Either Reply Integer) Source #

zcount :: (KnownSymbol s, SetOrNX xs s) => Proxy s -> Double -> Double -> Edis xs xs (Either Reply Integer) Source #

zincrby :: (KnownSymbol s, Serialize x, ZSetOrNX xs s) => Proxy s -> Integer -> x -> Edis xs (If (Member xs s) xs (Set xs s (ZSetOf x))) (Either Reply Double) Source #

zrange :: (KnownSymbol s, Serialize x, Just (ZSetOf x) ~ Get xs s) => Proxy s -> Integer -> Integer -> Edis xs xs (Either Reply [x]) Source #

zrangeWithscores :: (KnownSymbol s, Serialize x, Just (ZSetOf x) ~ Get xs s) => Proxy s -> Integer -> Integer -> Edis xs xs (Either Reply [(x, Double)]) Source #

zrangebyscore :: (KnownSymbol s, Serialize x, Just (ZSetOf x) ~ Get xs s) => Proxy s -> Double -> Double -> Edis xs xs (Either Reply [x]) Source #

zrangebyscoreWithscores :: (KnownSymbol s, Serialize x, Just (ZSetOf x) ~ Get xs s) => Proxy s -> Double -> Double -> Edis xs xs (Either Reply [(x, Double)]) Source #

zrangebyscoreLimit :: (KnownSymbol s, Serialize x, Just (ZSetOf x) ~ Get xs s) => Proxy s -> Double -> Double -> Integer -> Integer -> Edis xs xs (Either Reply [x]) Source #

zrangebyscoreWithscoresLimit :: (KnownSymbol s, Serialize x, Just (ZSetOf x) ~ Get xs s) => Proxy s -> Double -> Double -> Integer -> Integer -> Edis xs xs (Either Reply [(x, Double)]) Source #

zrank :: (KnownSymbol s, Serialize x, Just (ZSetOf x) ~ Get xs s) => Proxy s -> x -> Edis xs xs (Either Reply (Maybe Integer)) Source #

zremrangebyrank :: (KnownSymbol s, ZSetOrNX xs s) => Proxy s -> Integer -> Integer -> Edis xs xs (Either Reply Integer) Source #

zremrangebyscore :: (KnownSymbol s, ZSetOrNX xs s) => Proxy s -> Double -> Double -> Edis xs xs (Either Reply Integer) Source #

zrevrange :: (KnownSymbol s, Serialize x, Just (ZSetOf x) ~ Get xs s) => Proxy s -> Integer -> Integer -> Edis xs xs (Either Reply [x]) Source #

zrevrangeWithscores :: (KnownSymbol s, Serialize x, Just (ZSetOf x) ~ Get xs s) => Proxy s -> Integer -> Integer -> Edis xs xs (Either Reply [(x, Double)]) Source #

zrevrangebyscore :: (KnownSymbol s, Serialize x, Just (ZSetOf x) ~ Get xs s) => Proxy s -> Double -> Double -> Edis xs xs (Either Reply [x]) Source #

zrevrangebyscoreWithscores :: (KnownSymbol s, Serialize x, Just (ZSetOf x) ~ Get xs s) => Proxy s -> Double -> Double -> Edis xs xs (Either Reply [(x, Double)]) Source #

zrevrangebyscoreLimit :: (KnownSymbol s, Serialize x, Just (ZSetOf x) ~ Get xs s) => Proxy s -> Double -> Double -> Integer -> Integer -> Edis xs xs (Either Reply [x]) Source #

zrevrangebyscoreWithscoresLimit :: (KnownSymbol s, Serialize x, Just (ZSetOf x) ~ Get xs s) => Proxy s -> Double -> Double -> Integer -> Integer -> Edis xs xs (Either Reply [(x, Double)]) Source #

zrevrank :: (KnownSymbol s, Serialize x, Just (ZSetOf x) ~ Get xs s) => Proxy s -> x -> Edis xs xs (Either Reply (Maybe Integer)) Source #

zscore :: (KnownSymbol s, Serialize x, Just (ZSetOf x) ~ Get xs s) => Proxy s -> x -> Edis xs xs (Either Reply (Maybe Double)) Source #

## Server

configGet :: ByteString -> Edis xs xs (Either Reply [(ByteString, ByteString)]) Source #

configSet :: ByteString -> ByteString -> Edis xs xs (Either Reply Status) Source #

debugObject :: ByteString -> Edis xs xs (Either Reply ByteString) Source #

slaveof :: ByteString -> ByteString -> Edis xs xs (Either Reply Status) Source #

## Connection

echo :: ByteString -> Edis xs xs (Either Reply ByteString) Source #

## Scripting

eval :: RedisResult a => ByteString -> [ByteString] -> [ByteString] -> Edis xs xs (Either Reply a) Source #

evalsha :: RedisResult a => ByteString -> [ByteString] -> [ByteString] -> Edis xs xs (Either Reply a) Source #

scriptExists :: [ByteString] -> Edis xs xs (Either Reply [Bool]) Source #

scriptLoad :: ByteString -> Edis xs xs (Either Reply ByteString) Source #

## Pub/Sub

publish :: ByteString -> ByteString -> Edis xs xs (Either Reply Integer) Source #

:: [ByteString] | channel |

-> PubSub |

Listen for messages published to the given channels (http://redis.io/commands/subscribe).

:: [ByteString] | channel |

-> PubSub |

Stop listening for messages posted to the given channels (http://redis.io/commands/unsubscribe).

:: [ByteString] | pattern |

-> PubSub |

Listen for messages published to channels matching the given patterns (http://redis.io/commands/psubscribe).

:: [ByteString] | pattern |

-> PubSub |

Stop listening for messages posted to channels matching the given patterns (http://redis.io/commands/punsubscribe).

## Assertions on types

declare :: (KnownSymbol s, Member xs s ~ False) => Proxy s -> Proxy x -> Edis xs (Set xs s x) () Source #

data Proxy k t :: forall k. k -> * #

A concrete, poly-kinded proxy type

Monad (Proxy *) | |

Functor (Proxy *) | |

Applicative (Proxy *) | |

Traversable (Proxy *) | |

Generic1 (Proxy *) | |

Alternative (Proxy *) | |

MonadPlus (Proxy *) | |

Bounded (Proxy k s) | |

Enum (Proxy k s) | |

Eq (Proxy k s) | |

Ord (Proxy k s) | |

Read (Proxy k s) | |

Show (Proxy k s) | |

Ix (Proxy k s) | |

Generic (Proxy k t) | |

Monoid (Proxy k s) | |

type Rep1 (Proxy *) | |

type Rep (Proxy k t) | |

Low-level representation of replies from the Redis server.

runRedis :: Connection -> Redis a -> IO a #

Interact with a Redis datastore specified by the given `Connection`

.

Each call of `runRedis`

takes a network connection from the `Connection`

pool and runs the given `Redis`

action. Calls to `runRedis`

may thus block
while all connections from the pool are in use.

connect :: ConnectInfo -> IO Connection #

Constructs a `Connection`

pool to a Redis server designated by the
given `ConnectInfo`

. The first connection is not actually established
until the first call to the server.

defaultConnectInfo :: ConnectInfo #

Default information for connecting:

connectHost = "localhost" connectPort = PortNumber 6379 -- Redis default port connectAuth = Nothing -- No password connectDatabase = 0 -- SELECT database 0 connectMaxConnections = 50 -- Up to 50 connections connectMaxIdleTime = 30 -- Keep open for 30 seconds