module Database.Redis.List
( listRightPush
, listRightPushB
, listLeftPush
, listLeftPushB
, listLength
, listLengthB
, listRange
, listRangeB
, listIndex
, listIndexB
) where
import System.IO
import Database.Redis.Internal
listRightPush :: Handle
-> String
-> String
-> IO (Maybe RedisReply)
listRightPush h key value = request h $ map toUTF8 ["RPUSH", key, value]
listRightPushB :: Handle
-> ByteString
-> ByteString
-> IO (Maybe RedisReply)
listRightPushB h key value = request h [toUTF8 "RPUSH", key, value]
listLeftPush :: Handle
-> String
-> String
-> IO (Maybe RedisReply)
listLeftPush h key value = request h $ map toUTF8 ["LPUSH", key, value]
listLeftPushB :: Handle
-> ByteString
-> ByteString
-> IO (Maybe RedisReply)
listLeftPushB h key value = request h [toUTF8 "LPUSH", key, value]
listLength :: Handle
-> String
-> IO (Maybe RedisReply)
listLength h key = request h $ map toUTF8 ["LLEN", key]
listLengthB :: Handle
-> ByteString
-> IO (Maybe RedisReply)
listLengthB h key = request h [toUTF8 "LLEN", key]
listRange :: Handle
-> String
-> Int
-> Int
-> IO (Maybe RedisReply)
listRange h key start end =
request h $ map toUTF8 ["LRANGE", key, show start, show end]
listRangeB :: Handle
-> ByteString
-> Int
-> Int
-> IO (Maybe RedisReply)
listRangeB h key start end =
request h [toUTF8 "LRANGE", key, toUTF8 $ show start, toUTF8 $ show end]
listIndex :: Handle
-> String
-> Int
-> IO (Maybe RedisReply)
listIndex h key index =
request h $ map toUTF8 ["LINDEX", key, show index]
listIndexB :: Handle
-> ByteString
-> Int
-> IO (Maybe RedisReply)
listIndexB h key index =
request h [toUTF8 "LINDEX", key, toUTF8 $ show index]