redis-resp-1.0.0: REdis Serialization Protocol (RESP) implementation.
Safe HaskellNone
LanguageHaskell2010

Data.Redis.Command

Synopsis

Types

data Command a where Source #

Redis commands.

Constructors

Ping :: Resp -> Command () 
Echo :: forall a. FromByteString a => Resp -> Command a 
Auth :: Resp -> Command () 
Quit :: Resp -> Command () 
Select :: Resp -> Command () 
BgRewriteAOF :: Resp -> Command () 
BgSave :: Resp -> Command () 
Save :: Resp -> Command () 
DbSize :: Resp -> Command Int64 
FlushAll :: Resp -> Command () 
FlushDb :: Resp -> Command () 
LastSave :: Resp -> Command Int64 
Multi :: Resp -> Command () 
Watch :: Resp -> Command () 
Unwatch :: Resp -> Command () 
Discard :: Resp -> Command () 
Exec :: Resp -> Command () 
Del :: Resp -> Command Int64 
Dump :: Resp -> Command (Maybe ByteString) 
Exists :: Resp -> Command Bool 
Expire :: Resp -> Command Bool 
ExpireAt :: Resp -> Command Bool 
Persist :: Resp -> Command Bool 
Keys :: Resp -> Command [Key] 
RandomKey :: Resp -> Command (Maybe Key) 
Rename :: Resp -> Command () 
RenameNx :: Resp -> Command Bool 
Sort :: forall a1. FromByteString a1 => Resp -> Command [a1] 
Ttl :: Resp -> Command (Maybe TTL) 
Type :: Resp -> Command (Maybe RedisType) 
Scan :: forall a1. FromByteString a1 => Resp -> Command (Cursor, [a1]) 
Append :: Resp -> Command Int64 
Get :: forall a1. FromByteString a1 => Resp -> Command (Maybe a1) 
GetRange :: forall a. FromByteString a => Resp -> Command a 
GetSet :: forall a1. FromByteString a1 => Resp -> Command (Maybe a1) 
MGet :: forall a1. FromByteString a1 => Resp -> Command [Maybe a1] 
MSet :: Resp -> Command () 
MSetNx :: Resp -> Command Bool 
Set :: Resp -> Command Bool 
SetRange :: Resp -> Command Int64 
StrLen :: Resp -> Command Int64 
BitAnd :: Resp -> Command Int64 
BitCount :: Resp -> Command Int64 
BitNot :: Resp -> Command Int64 
BitOr :: Resp -> Command Int64 
BitPos :: Resp -> Command Int64 
BitXOr :: Resp -> Command Int64 
GetBit :: Resp -> Command Int64 
SetBit :: Resp -> Command Int64 
Decr :: Resp -> Command Int64 
DecrBy :: Resp -> Command Int64 
Incr :: Resp -> Command Int64 
IncrBy :: Resp -> Command Int64 
IncrByFloat :: Resp -> Command Double 
HDel :: Resp -> Command Int64 
HExists :: Resp -> Command Bool 
HGet :: forall a1. FromByteString a1 => Resp -> Command (Maybe a1) 
HGetAll :: forall a1. FromByteString a1 => Resp -> Command [(Field, a1)] 
HIncrBy :: Resp -> Command Int64 
HIncrByFloat :: Resp -> Command Double 
HKeys :: Resp -> Command [Field] 
HLen :: Resp -> Command Int64 
HMGet :: forall a1. FromByteString a1 => Resp -> Command [Maybe a1] 
HMSet :: Resp -> Command () 
HSet :: Resp -> Command Bool 
HSetNx :: Resp -> Command Bool 
HVals :: forall a1. FromByteString a1 => Resp -> Command [a1] 
HScan :: forall a1. FromByteString a1 => Resp -> Command (Cursor, [a1]) 
BLPop :: forall a1. FromByteString a1 => Int64 -> Resp -> Command (Maybe (Key, a1)) 
BRPop :: forall a1. FromByteString a1 => Int64 -> Resp -> Command (Maybe (Key, a1)) 
BRPopLPush :: forall a1. FromByteString a1 => Int64 -> Resp -> Command (Maybe a1) 
LIndex :: forall a1. FromByteString a1 => Resp -> Command (Maybe a1) 
LInsert :: Resp -> Command Int64 
LLen :: Resp -> Command Int64 
LPop :: forall a1. FromByteString a1 => Resp -> Command (Maybe a1) 
LPush :: Resp -> Command Int64 
LPushX :: Resp -> Command Int64 
LRange :: forall a1. FromByteString a1 => Resp -> Command [a1] 
LRem :: Resp -> Command Int64 
LSet :: Resp -> Command () 
LTrim :: Resp -> Command () 
RPop :: forall a1. FromByteString a1 => Resp -> Command (Maybe a1) 
RPopLPush :: forall a1. FromByteString a1 => Resp -> Command (Maybe a1) 
RPush :: Resp -> Command Int64 
RPushX :: Resp -> Command Int64 
SAdd :: Resp -> Command Int64 
SCard :: Resp -> Command Int64 
SDiff :: forall a1. FromByteString a1 => Resp -> Command [a1] 
SDiffStore :: Resp -> Command Int64 
SInter :: forall a1. FromByteString a1 => Resp -> Command [a1] 
SInterStore :: Resp -> Command Int64 
SIsMember :: Resp -> Command Bool 
SMembers :: forall a1. FromByteString a1 => Resp -> Command [a1] 
SMove :: Resp -> Command Bool 
SPop :: forall a1. FromByteString a1 => Resp -> Command (Maybe a1) 
SRandMember :: forall a1. FromByteString a1 => Choose -> Resp -> Command [a1] 
SRem :: Resp -> Command Int64 
SScan :: forall a1. FromByteString a1 => Resp -> Command (Cursor, [a1]) 
SUnion :: forall a1. FromByteString a1 => Resp -> Command [a1] 
SUnionStore :: Resp -> Command Int64 
ZAdd :: Resp -> Command Int64 
ZCard :: Resp -> Command Int64 
ZCount :: Resp -> Command Int64 
ZIncrBy :: Resp -> Command Double 
ZInterStore :: Resp -> Command Int64 
ZLexCount :: Resp -> Command Int64 
ZRange :: forall a1. FromByteString a1 => Bool -> Resp -> Command (ScoreList a1) 
ZRangeByLex :: forall a1. FromByteString a1 => Resp -> Command [a1] 
ZRangeByScore :: forall a1. FromByteString a1 => Bool -> Resp -> Command (ScoreList a1) 
ZRank :: Resp -> Command (Maybe Int64) 
ZRem :: Resp -> Command Int64 
ZRemRangeByLex :: Resp -> Command Int64 
ZRemRangeByRank :: Resp -> Command Int64 
ZRemRangeByScore :: Resp -> Command Int64 
ZRevRange :: forall a1. FromByteString a1 => Bool -> Resp -> Command (ScoreList a1) 
ZRevRangeByScore :: forall a1. FromByteString a1 => Bool -> Resp -> Command (ScoreList a1) 
ZRevRank :: Resp -> Command (Maybe Int64) 
ZScan :: forall a1. FromByteString a1 => Resp -> Command (Cursor, [a1]) 
ZScore :: Resp -> Command (Maybe Double) 
ZUnionStore :: Resp -> Command Int64 
PfAdd :: Resp -> Command Bool 
PfCount :: Resp -> Command Int64 
PfMerge :: Resp -> Command () 
Publish :: Resp -> Command Int64 

data PubSubCommand r where Source #

Pub/Sub commands.

data RedisError Source #

Redis error type.

Constructors

RedisError !ByteString

General error case.

InvalidResponse !String

The received response is invalid or unexpected (e.g. a bulk string instead of an integer).

InvalidConversion !String

ByteString conversion using FromByteString failed.

data RedisType Source #

The types redis reports via type.

Instances

Instances details
Show RedisType Source # 
Instance details

Defined in Data.Redis.Command

Eq RedisType Source # 
Instance details

Defined in Data.Redis.Command

Ord RedisType Source # 
Instance details

Defined in Data.Redis.Command

data TTL Source #

A type representing time-to-live values.

Constructors

NoTTL 
TTL !Int64 

Instances

Instances details
Show TTL Source # 
Instance details

Defined in Data.Redis.Command

Methods

showsPrec :: Int -> TTL -> ShowS #

show :: TTL -> String #

showList :: [TTL] -> ShowS #

Eq TTL Source # 
Instance details

Defined in Data.Redis.Command

Methods

(==) :: TTL -> TTL -> Bool #

(/=) :: TTL -> TTL -> Bool #

Ord TTL Source # 
Instance details

Defined in Data.Redis.Command

Methods

compare :: TTL -> TTL -> Ordering #

(<) :: TTL -> TTL -> Bool #

(<=) :: TTL -> TTL -> Bool #

(>) :: TTL -> TTL -> Bool #

(>=) :: TTL -> TTL -> Bool #

max :: TTL -> TTL -> TTL #

min :: TTL -> TTL -> TTL #

data Side Source #

Used in linsert to specify the insertion point.

Constructors

Before 
After 

Instances

Instances details
Show Side Source # 
Instance details

Defined in Data.Redis.Command

Methods

showsPrec :: Int -> Side -> ShowS #

show :: Side -> String #

showList :: [Side] -> ShowS #

Eq Side Source # 
Instance details

Defined in Data.Redis.Command

Methods

(==) :: Side -> Side -> Bool #

(/=) :: Side -> Side -> Bool #

Ord Side Source # 
Instance details

Defined in Data.Redis.Command

Methods

compare :: Side -> Side -> Ordering #

(<) :: Side -> Side -> Bool #

(<=) :: Side -> Side -> Bool #

(>) :: Side -> Side -> Bool #

(>=) :: Side -> Side -> Bool #

max :: Side -> Side -> Side #

min :: Side -> Side -> Side #

data Choose Source #

Constructors

One

Exactly one element

Dist !Int64

n distint elements

Arb !Int64

n arbitrary (i.e. potentially repeated) elements

Instances

Instances details
Show Choose Source # 
Instance details

Defined in Data.Redis.Command

Eq Choose Source # 
Instance details

Defined in Data.Redis.Command

Methods

(==) :: Choose -> Choose -> Bool #

(/=) :: Choose -> Choose -> Bool #

Ord Choose Source # 
Instance details

Defined in Data.Redis.Command

data Aggregate Source #

Constructors

None

no aggregation

Min

take the minimum score

Max

take the maximum score

Sum

addition of scores

Instances

Instances details
Show Aggregate Source # 
Instance details

Defined in Data.Redis.Command

Eq Aggregate Source # 
Instance details

Defined in Data.Redis.Command

Ord Aggregate Source # 
Instance details

Defined in Data.Redis.Command

data Min Source #

Constructors

MinIncl !ByteString

lower bound (inclusive)

MinExcl !ByteString

lower bound (exclusive)

MinInf

infinite lower bound

Instances

Instances details
Show Min Source # 
Instance details

Defined in Data.Redis.Command

Methods

showsPrec :: Int -> Min -> ShowS #

show :: Min -> String #

showList :: [Min] -> ShowS #

Eq Min Source # 
Instance details

Defined in Data.Redis.Command

Methods

(==) :: Min -> Min -> Bool #

(/=) :: Min -> Min -> Bool #

Ord Min Source # 
Instance details

Defined in Data.Redis.Command

Methods

compare :: Min -> Min -> Ordering #

(<) :: Min -> Min -> Bool #

(<=) :: Min -> Min -> Bool #

(>) :: Min -> Min -> Bool #

(>=) :: Min -> Min -> Bool #

max :: Min -> Min -> Min #

min :: Min -> Min -> Min #

data Max Source #

Constructors

MaxIncl !ByteString

upper bound (inclusive)

MaxExcl !ByteString

upper bound (exclusive)

MaxInf

infinite upper bound

Instances

Instances details
Show Max Source # 
Instance details

Defined in Data.Redis.Command

Methods

showsPrec :: Int -> Max -> ShowS #

show :: Max -> String #

showList :: [Max] -> ShowS #

Eq Max Source # 
Instance details

Defined in Data.Redis.Command

Methods

(==) :: Max -> Max -> Bool #

(/=) :: Max -> Max -> Bool #

Ord Max Source # 
Instance details

Defined in Data.Redis.Command

Methods

compare :: Max -> Max -> Ordering #

(<) :: Max -> Max -> Bool #

(<=) :: Max -> Max -> Bool #

(>) :: Max -> Max -> Bool #

(>=) :: Max -> Max -> Bool #

max :: Max -> Max -> Max #

min :: Max -> Max -> Max #

data ScoreList a Source #

Constructors

ScoreList 

Fields

Instances

Instances details
Show a => Show (ScoreList a) Source # 
Instance details

Defined in Data.Redis.Command

Eq a => Eq (ScoreList a) Source # 
Instance details

Defined in Data.Redis.Command

Methods

(==) :: ScoreList a -> ScoreList a -> Bool #

(/=) :: ScoreList a -> ScoreList a -> Bool #

Ord a => Ord (ScoreList a) Source # 
Instance details

Defined in Data.Redis.Command

newtype Seconds Source #

Constructors

Seconds Int64 

newtype Milliseconds Source #

Constructors

Milliseconds Int64 

newtype Timestamp Source #

Constructors

Timestamp Int64 

newtype Key Source #

Redis key type

Constructors

Key 

Fields

Instances

Instances details
IsString Key Source # 
Instance details

Defined in Data.Redis.Command

Methods

fromString :: String -> Key #

Show Key Source # 
Instance details

Defined in Data.Redis.Command

Methods

showsPrec :: Int -> Key -> ShowS #

show :: Key -> String #

showList :: [Key] -> ShowS #

FromByteString Key Source # 
Instance details

Defined in Data.Redis.Command

Methods

parser :: Parser Key #

Eq Key Source # 
Instance details

Defined in Data.Redis.Command

Methods

(==) :: Key -> Key -> Bool #

(/=) :: Key -> Key -> Bool #

Ord Key Source # 
Instance details

Defined in Data.Redis.Command

Methods

compare :: Key -> Key -> Ordering #

(<) :: Key -> Key -> Bool #

(<=) :: Key -> Key -> Bool #

(>) :: Key -> Key -> Bool #

(>=) :: Key -> Key -> Bool #

max :: Key -> Key -> Key #

min :: Key -> Key -> Key #

Cursor

data Cursor Source #

Instances

Instances details
Show Cursor Source # 
Instance details

Defined in Data.Redis.Command

FromByteString Cursor Source # 
Instance details

Defined in Data.Redis.Command

Methods

parser :: Parser Cursor #

Eq Cursor Source # 
Instance details

Defined in Data.Redis.Command

Methods

(==) :: Cursor -> Cursor -> Bool #

(/=) :: Cursor -> Cursor -> Bool #

Ord Cursor Source # 
Instance details

Defined in Data.Redis.Command

Non-empty lists

one :: a -> NonEmpty a Source #

Options

data Opts (a :: Symbol) Source #

Command options

Instances

Instances details
Monoid (Opts a) Source # 
Instance details

Defined in Data.Redis.Command

Methods

mempty :: Opts a #

mappend :: Opts a -> Opts a -> Opts a #

mconcat :: [Opts a] -> Opts a #

Semigroup (Opts a) Source # 
Instance details

Defined in Data.Redis.Command

Methods

(<>) :: Opts a -> Opts a -> Opts a #

sconcat :: NonEmpty (Opts a) -> Opts a #

stimes :: Integral b => b -> Opts a -> Opts a #

none :: Monoid m => m Source #

Bit

data BitStart Source #

Instances

Instances details
Monoid BitStart Source # 
Instance details

Defined in Data.Redis.Command

Semigroup BitStart Source # 
Instance details

Defined in Data.Redis.Command

data BitEnd Source #

Instances

Instances details
Monoid BitEnd Source # 
Instance details

Defined in Data.Redis.Command

Semigroup BitEnd Source # 
Instance details

Defined in Data.Redis.Command

Commands

Connection

auth :: forall (m :: Type -> Type). Monad m => ByteString -> Redis m () Source #

echo :: forall (m :: Type -> Type) a. (Monad m, ToByteString a, FromByteString a) => a -> Redis m a Source #

ping :: forall (m :: Type -> Type). Monad m => Redis m () Source #

quit :: forall (m :: Type -> Type). Monad m => Redis m () Source #

select :: forall (m :: Type -> Type). Monad m => Int64 -> Redis m () Source #

Server

bgrewriteaof :: forall (m :: Type -> Type). Monad m => Redis m () Source #

bgsave :: forall (m :: Type -> Type). Monad m => Redis m () Source #

dbsize :: forall (m :: Type -> Type). Monad m => Redis m Int64 Source #

flushall :: forall (m :: Type -> Type). Monad m => Redis m () Source #

flushdb :: forall (m :: Type -> Type). Monad m => Redis m () Source #

lastsave :: forall (m :: Type -> Type). Monad m => Redis m Int64 Source #

save :: forall (m :: Type -> Type). Monad m => Redis m () Source #

Transactions

discard :: forall (m :: Type -> Type). Monad m => Redis m () Source #

exec :: forall (m :: Type -> Type). Monad m => Redis m () Source #

multi :: forall (m :: Type -> Type). Monad m => Redis m () Source #

Note that all commands following multi and until exec are queued by a Redis server. Therefore the result of any such command is not available until the exec command completes. For example, the following is an invalid Redis program:

 multi
 x <- hexists "FOO" "BAR"
 unless x (void $ hset "FOO" "BAR" 1)
 exec

This pattern is usually indicative of the desire for a transactional check-and-set operation, which may be achieved instead by the following valid command sequence:

 watch ("FOO" R.:| [])
 x <- hexists "FOO" "BAR"
 multi
 unless x (void $ hset "FOO" "BAR" 1)
 exec

For more information on Redis transactions and conditional updates, see https://redis.io/topics/transactions.

unwatch :: forall (m :: Type -> Type). Monad m => Redis m () Source #

watch :: forall (m :: Type -> Type). Monad m => NonEmpty Key -> Redis m () Source #

Keys

del :: forall (m :: Type -> Type). Monad m => NonEmpty Key -> Redis m Int64 Source #

dump :: forall (m :: Type -> Type). Monad m => Key -> Redis m (Maybe ByteString) Source #

exists :: forall (m :: Type -> Type). Monad m => Key -> Redis m Bool Source #

expire :: forall (m :: Type -> Type). Monad m => Key -> Seconds -> Redis m Bool Source #

expireat :: forall (m :: Type -> Type). Monad m => Key -> Timestamp -> Redis m Bool Source #

keys :: forall (m :: Type -> Type). Monad m => ByteString -> Redis m [Key] Source #

persist :: forall (m :: Type -> Type). Monad m => Key -> Redis m Bool Source #

randomkey :: forall (m :: Type -> Type). Monad m => Redis m (Maybe Key) Source #

rename :: forall (m :: Type -> Type). Monad m => Key -> Key -> Redis m () Source #

renamenx :: forall (m :: Type -> Type). Monad m => Key -> Key -> Redis m Bool Source #

ttl :: forall (m :: Type -> Type). Monad m => Key -> Redis m (Maybe TTL) Source #

typeof :: forall (m :: Type -> Type). Monad m => Key -> Redis m (Maybe RedisType) Source #

Strings

append :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> a -> Redis m Int64 Source #

decr :: forall (m :: Type -> Type). Monad m => Key -> Redis m Int64 Source #

decrby :: forall (m :: Type -> Type). Monad m => Key -> Int64 -> Redis m Int64 Source #

get :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Redis m (Maybe a) Source #

getrange :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Int64 -> Int64 -> Redis m a Source #

getset :: forall (m :: Type -> Type) a b. (Monad m, ToByteString a, FromByteString b) => Key -> a -> Redis m (Maybe b) Source #

incr :: forall (m :: Type -> Type). Monad m => Key -> Redis m Int64 Source #

incrby :: forall (m :: Type -> Type). Monad m => Key -> Int64 -> Redis m Int64 Source #

incrbyfloat :: forall (m :: Type -> Type). Monad m => Key -> Double -> Redis m Double Source #

mget :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => NonEmpty Key -> Redis m [Maybe a] Source #

mset :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => NonEmpty (Key, a) -> Redis m () Source #

msetnx :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => NonEmpty (Key, a) -> Redis m Bool Source #

set :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> a -> Opts "SET" -> Redis m Bool Source #

ex :: Seconds -> Opts "SET" Source #

xx :: Opts "SET" Source #

nx :: Opts "SET" Source #

setrange :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> Int64 -> a -> Redis m Int64 Source #

strlen :: forall (m :: Type -> Type). Monad m => Key -> Redis m Int64 Source #

Bits

bitand :: forall (m :: Type -> Type). Monad m => Key -> NonEmpty Key -> Redis m Int64 Source #

bitcount :: forall (m :: Type -> Type). Monad m => Key -> Opts "RANGE" -> Redis m Int64 Source #

range :: Int64 -> Int64 -> Opts "RANGE" Source #

bitnot :: forall (m :: Type -> Type). Monad m => Key -> Key -> Redis m Int64 Source #

bitor :: forall (m :: Type -> Type). Monad m => Key -> NonEmpty Key -> Redis m Int64 Source #

bitpos :: forall (m :: Type -> Type). Monad m => Key -> Bool -> BitStart -> BitEnd -> Redis m Int64 Source #

bitxor :: forall (m :: Type -> Type). Monad m => Key -> NonEmpty Key -> Redis m Int64 Source #

getbit :: forall (m :: Type -> Type). Monad m => Key -> Int64 -> Redis m Int64 Source #

setbit :: forall (m :: Type -> Type). Monad m => Key -> Int64 -> Bool -> Redis m Int64 Source #

Hashes

hdel :: forall (m :: Type -> Type). Monad m => Key -> NonEmpty Field -> Redis m Int64 Source #

hexists :: forall (m :: Type -> Type). Monad m => Key -> Field -> Redis m Bool Source #

hget :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Field -> Redis m (Maybe a) Source #

hgetall :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Redis m [(Field, a)] Source #

hincrby :: forall (m :: Type -> Type). Monad m => Key -> Field -> Int64 -> Redis m Int64 Source #

hincrbyfloat :: forall (m :: Type -> Type). Monad m => Key -> Field -> Double -> Redis m Double Source #

hkeys :: forall (m :: Type -> Type). Monad m => Key -> Redis m [Field] Source #

hlen :: forall (m :: Type -> Type). Monad m => Key -> Redis m Int64 Source #

hmget :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> NonEmpty Field -> Redis m [Maybe a] Source #

hmset :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> NonEmpty (Field, a) -> Redis m () Source #

hset :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> Field -> a -> Redis m Bool Source #

hsetnx :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> Field -> a -> Redis m Bool Source #

hvals :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Redis m [a] Source #

Lists

blpop :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => NonEmpty Key -> Seconds -> Redis m (Maybe (Key, a)) Source #

brpop :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => NonEmpty Key -> Seconds -> Redis m (Maybe (Key, a)) Source #

brpoplpush :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Key -> Seconds -> Redis m (Maybe a) Source #

lindex :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Index -> Redis m (Maybe a) Source #

linsert :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> Side -> a -> a -> Redis m Int64 Source #

llen :: forall (m :: Type -> Type). Monad m => Key -> Redis m Int64 Source #

lpop :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Redis m (Maybe a) Source #

lpush :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> NonEmpty a -> Redis m Int64 Source #

lpushx :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> a -> Redis m Int64 Source #

lrange :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Int64 -> Int64 -> Redis m [a] Source #

lrem :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> Int64 -> a -> Redis m Int64 Source #

lset :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> Int64 -> a -> Redis m () Source #

ltrim :: forall (m :: Type -> Type). Monad m => Key -> Int64 -> Int64 -> Redis m () Source #

rpop :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Redis m (Maybe a) Source #

rpoplpush :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Key -> Redis m (Maybe a) Source #

rpush :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> NonEmpty a -> Redis m Int64 Source #

rpushx :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> a -> Redis m Int64 Source #

Sets

sadd :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> NonEmpty a -> Redis m Int64 Source #

scard :: forall (m :: Type -> Type). Monad m => Key -> Redis m Int64 Source #

sdiff :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => NonEmpty Key -> Redis m [a] Source #

sdiffstore :: forall (m :: Type -> Type). Monad m => Key -> NonEmpty Key -> Redis m Int64 Source #

sinter :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => NonEmpty Key -> Redis m [a] Source #

sinterstore :: forall (m :: Type -> Type). Monad m => Key -> NonEmpty Key -> Redis m Int64 Source #

sismember :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> a -> Redis m Bool Source #

smembers :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Redis m [a] Source #

smove :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> Key -> a -> Redis m Bool Source #

spop :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Redis m (Maybe a) Source #

srandmember :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Choose -> Redis m [a] Source #

srem :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> NonEmpty a -> Redis m Int64 Source #

sunion :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => NonEmpty Key -> Redis m [a] Source #

sunionstore :: forall (m :: Type -> Type). Monad m => Key -> NonEmpty Key -> Redis m Int64 Source #

Sorted Sets

zadd :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> NonEmpty (Double, a) -> Redis m Int64 Source #

zcard :: forall (m :: Type -> Type). Monad m => Key -> Redis m Int64 Source #

zcount :: forall (m :: Type -> Type). Monad m => Key -> Double -> Double -> Redis m Int64 Source #

zincrby :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> Double -> a -> Redis m Double Source #

zinterstore :: forall (m :: Type -> Type). Monad m => Key -> NonEmpty Key -> [Int64] -> Aggregate -> Redis m Int64 Source #

zlexcount :: forall (m :: Type -> Type). Monad m => Key -> Min -> Max -> Redis m Int64 Source #

zrange :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Int64 -> Int64 -> Bool -> Redis m (ScoreList a) Source #

zrangebylex :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Min -> Max -> Opts "LIMIT" -> Redis m [a] Source #

zrangebyscore :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Double -> Double -> Bool -> Opts "LIMIT" -> Redis m (ScoreList a) Source #

zrank :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> a -> Redis m (Maybe Int64) Source #

zrem :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> NonEmpty a -> Redis m Int64 Source #

zremrangebylex :: forall (m :: Type -> Type). Monad m => Key -> Min -> Max -> Redis m Int64 Source #

zremrangebyrank :: forall (m :: Type -> Type). Monad m => Key -> Int64 -> Int64 -> Redis m Int64 Source #

zremrangebyscore :: forall (m :: Type -> Type). Monad m => Key -> Double -> Double -> Redis m Int64 Source #

zrevrangebyscore :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Double -> Double -> Bool -> Opts "LIMIT" -> Redis m (ScoreList a) Source #

zrevrange :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Int64 -> Int64 -> Bool -> Redis m (ScoreList a) Source #

zrevrank :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> a -> Redis m (Maybe Int64) Source #

zscore :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> a -> Redis m (Maybe Double) Source #

zunionstore :: forall (m :: Type -> Type). Monad m => Key -> NonEmpty Key -> [Int64] -> Aggregate -> Redis m Int64 Source #

HyperLogLog

pfadd :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> NonEmpty a -> Redis m Bool Source #

pfcount :: forall (m :: Type -> Type). Monad m => NonEmpty Key -> Redis m Int64 Source #

pfmerge :: forall (m :: Type -> Type). Monad m => Key -> NonEmpty Key -> Redis m () Source #

Scan

scan :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Cursor -> Opts "SCAN" -> Redis m (Cursor, [a]) Source #

count :: Int64 -> Opts "SCAN" Source #

hscan :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Cursor -> Opts "SCAN" -> Redis m (Cursor, [a]) Source #

sscan :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Cursor -> Opts "SCAN" -> Redis m (Cursor, [a]) Source #

zscan :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Cursor -> Opts "SCAN" -> Redis m (Cursor, [a]) Source #

Sort

sort :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Opts "SORT" -> Redis m [a] Source #

by :: ByteString -> Opts "SORT" Source #

limit :: forall (o :: Symbol). Int64 -> Int64 -> Opts o Source #

asc :: Opts "SORT" Source #

desc :: Opts "SORT" Source #

alpha :: Opts "SORT" Source #

store :: Key -> Opts "SORT" Source #

Pub/Sub

publish :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => ByteString -> a -> Redis m Int64 Source #

subscribe :: forall (m :: Type -> Type). Monad m => NonEmpty ByteString -> PubSub m () Source #

psubscribe :: forall (m :: Type -> Type). Monad m => NonEmpty ByteString -> PubSub m () Source #

unsubscribe :: forall (m :: Type -> Type). Monad m => [ByteString] -> PubSub m () Source #

punsubscribe :: forall (m :: Type -> Type). Monad m => [ByteString] -> PubSub m () Source #

Response Reading

Re-exports

data NonEmpty a #

Non-empty (and non-strict) list type.

Since: base-4.9.0.0

Constructors

a :| [a] infixr 5 

Instances

Instances details
MonadFix NonEmpty

Since: base-4.9.0.0

Instance details

Defined in Control.Monad.Fix

Methods

mfix :: (a -> NonEmpty a) -> NonEmpty a #

MonadZip NonEmpty

Since: base-4.9.0.0

Instance details

Defined in Control.Monad.Zip

Methods

mzip :: NonEmpty a -> NonEmpty b -> NonEmpty (a, b) #

mzipWith :: (a -> b -> c) -> NonEmpty a -> NonEmpty b -> NonEmpty c #

munzip :: NonEmpty (a, b) -> (NonEmpty a, NonEmpty b) #

Foldable NonEmpty

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => NonEmpty m -> m #

foldMap :: Monoid m => (a -> m) -> NonEmpty a -> m #

foldMap' :: Monoid m => (a -> m) -> NonEmpty a -> m #

foldr :: (a -> b -> b) -> b -> NonEmpty a -> b #

foldr' :: (a -> b -> b) -> b -> NonEmpty a -> b #

foldl :: (b -> a -> b) -> b -> NonEmpty a -> b #

foldl' :: (b -> a -> b) -> b -> NonEmpty a -> b #

foldr1 :: (a -> a -> a) -> NonEmpty a -> a #

foldl1 :: (a -> a -> a) -> NonEmpty a -> a #

toList :: NonEmpty a -> [a] #

null :: NonEmpty a -> Bool #

length :: NonEmpty a -> Int #

elem :: Eq a => a -> NonEmpty a -> Bool #

maximum :: Ord a => NonEmpty a -> a #

minimum :: Ord a => NonEmpty a -> a #

sum :: Num a => NonEmpty a -> a #

product :: Num a => NonEmpty a -> a #

Foldable1 NonEmpty

Since: base-4.18.0.0

Instance details

Defined in Data.Foldable1

Methods

fold1 :: Semigroup m => NonEmpty m -> m #

foldMap1 :: Semigroup m => (a -> m) -> NonEmpty a -> m #

foldMap1' :: Semigroup m => (a -> m) -> NonEmpty a -> m #

toNonEmpty :: NonEmpty a -> NonEmpty a #

maximum :: Ord a => NonEmpty a -> a #

minimum :: Ord a => NonEmpty a -> a #

head :: NonEmpty a -> a #

last :: NonEmpty a -> a #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> NonEmpty a -> b #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> NonEmpty a -> b #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> NonEmpty a -> b #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> NonEmpty a -> b #

Eq1 NonEmpty

Since: base-4.10.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftEq :: (a -> b -> Bool) -> NonEmpty a -> NonEmpty b -> Bool #

Ord1 NonEmpty

Since: base-4.10.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftCompare :: (a -> b -> Ordering) -> NonEmpty a -> NonEmpty b -> Ordering #

Read1 NonEmpty

Since: base-4.10.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (NonEmpty a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [NonEmpty a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (NonEmpty a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [NonEmpty a] #

Show1 NonEmpty

Since: base-4.10.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> NonEmpty a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [NonEmpty a] -> ShowS #

Traversable NonEmpty

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> NonEmpty a -> f (NonEmpty b) #

sequenceA :: Applicative f => NonEmpty (f a) -> f (NonEmpty a) #

mapM :: Monad m => (a -> m b) -> NonEmpty a -> m (NonEmpty b) #

sequence :: Monad m => NonEmpty (m a) -> m (NonEmpty a) #

Applicative NonEmpty

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

pure :: a -> NonEmpty a #

(<*>) :: NonEmpty (a -> b) -> NonEmpty a -> NonEmpty b #

liftA2 :: (a -> b -> c) -> NonEmpty a -> NonEmpty b -> NonEmpty c #

(*>) :: NonEmpty a -> NonEmpty b -> NonEmpty b #

(<*) :: NonEmpty a -> NonEmpty b -> NonEmpty a #

Functor NonEmpty

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

fmap :: (a -> b) -> NonEmpty a -> NonEmpty b #

(<$) :: a -> NonEmpty b -> NonEmpty a #

Monad NonEmpty

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

(>>=) :: NonEmpty a -> (a -> NonEmpty b) -> NonEmpty b #

(>>) :: NonEmpty a -> NonEmpty b -> NonEmpty b #

return :: a -> NonEmpty a #

Hashable1 NonEmpty

Since: hashable-1.3.1.0

Instance details

Defined in Data.Hashable.Class

Methods

liftHashWithSalt :: (Int -> a -> Int) -> Int -> NonEmpty a -> Int #

Generic1 NonEmpty 
Instance details

Defined in GHC.Generics

Associated Types

type Rep1 NonEmpty

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Methods

from1 :: NonEmpty a -> Rep1 NonEmpty a #

to1 :: Rep1 NonEmpty a -> NonEmpty a #

Lift a => Lift (NonEmpty a :: Type)

Since: template-haskell-2.15.0.0

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: Quote m => NonEmpty a -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => NonEmpty a -> Code m (NonEmpty a) #

Data a => Data (NonEmpty a)

Since: base-4.9.0.0

Instance details

Defined in Data.Data

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NonEmpty a -> c (NonEmpty a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (NonEmpty a) #

toConstr :: NonEmpty a -> Constr #

dataTypeOf :: NonEmpty a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (NonEmpty a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (NonEmpty a)) #

gmapT :: (forall b. Data b => b -> b) -> NonEmpty a -> NonEmpty a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NonEmpty a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NonEmpty a -> r #

gmapQ :: (forall d. Data d => d -> u) -> NonEmpty a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> NonEmpty a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> NonEmpty a -> m (NonEmpty a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NonEmpty a -> m (NonEmpty a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NonEmpty a -> m (NonEmpty a) #

Semigroup (NonEmpty a)

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

(<>) :: NonEmpty a -> NonEmpty a -> NonEmpty a #

sconcat :: NonEmpty (NonEmpty a) -> NonEmpty a #

stimes :: Integral b => b -> NonEmpty a -> NonEmpty a #

Generic (NonEmpty a) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (NonEmpty a)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Methods

from :: NonEmpty a -> Rep (NonEmpty a) x #

to :: Rep (NonEmpty a) x -> NonEmpty a #

IsList (NonEmpty a)

Since: base-4.9.0.0

Instance details

Defined in GHC.IsList

Associated Types

type Item (NonEmpty a) 
Instance details

Defined in GHC.IsList

type Item (NonEmpty a) = a

Methods

fromList :: [Item (NonEmpty a)] -> NonEmpty a #

fromListN :: Int -> [Item (NonEmpty a)] -> NonEmpty a #

toList :: NonEmpty a -> [Item (NonEmpty a)] #

Read a => Read (NonEmpty a)

Since: base-4.11.0.0

Instance details

Defined in GHC.Read

Show a => Show (NonEmpty a)

Since: base-4.11.0.0

Instance details

Defined in GHC.Show

Methods

showsPrec :: Int -> NonEmpty a -> ShowS #

show :: NonEmpty a -> String #

showList :: [NonEmpty a] -> ShowS #

Eq a => Eq (NonEmpty a)

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

(==) :: NonEmpty a -> NonEmpty a -> Bool #

(/=) :: NonEmpty a -> NonEmpty a -> Bool #

Ord a => Ord (NonEmpty a)

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

compare :: NonEmpty a -> NonEmpty a -> Ordering #

(<) :: NonEmpty a -> NonEmpty a -> Bool #

(<=) :: NonEmpty a -> NonEmpty a -> Bool #

(>) :: NonEmpty a -> NonEmpty a -> Bool #

(>=) :: NonEmpty a -> NonEmpty a -> Bool #

max :: NonEmpty a -> NonEmpty a -> NonEmpty a #

min :: NonEmpty a -> NonEmpty a -> NonEmpty a #

Hashable a => Hashable (NonEmpty a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> NonEmpty a -> Int #

hash :: NonEmpty a -> Int #

type Rep1 NonEmpty

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

type Rep (NonEmpty a)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

type Item (NonEmpty a) 
Instance details

Defined in GHC.IsList

type Item (NonEmpty a) = a

nonEmpty :: [a] -> Maybe (NonEmpty a) #

nonEmpty efficiently turns a normal list into a NonEmpty stream, producing Nothing if the input is empty.