redis-simple-0.1.1: Simple redis bindings for Haskell

Database.Redis.Simple

Contents

Description

This module is meant to make working with redis in Haskell more simple. It is a small layer above the full-blown redis package.

It only supports a small subset of the redis features.

Synopsis

Type for keys

newtype Key Source

Type for a key in the key-value store

Constructors

Key 

Fields

unKey :: ByteString
 

Working with simple key-value pairs

itemGetSource

Arguments

:: Binary a 
=> Redis

Redis handle

-> Key

Key of the value to get

-> IO (Maybe a)

Resulting value

Gets an item from the database

itemExistsSource

Arguments

:: Redis

Redis handle

-> Key

Key to test

-> IO Bool

If the key exists

Checks if an item with a given key exists

itemSetSource

Arguments

:: Binary a 
=> Redis

Redis handle

-> Key

Key

-> a

Value

-> IO ()

No result

Set an item in the database

itemDeleteSource

Arguments

:: Redis

Redis handle

-> Key

Key

-> IO ()

No result

Delete an item in the database

Working with sets

setAddSource

Arguments

:: Binary a 
=> Redis

Redis handle

-> Key

Key of the set

-> a

Item to add to the set

-> IO ()

No result

Add an item to a redis set

setRemoveSource

Arguments

:: Binary a 
=> Redis

Redis handle

-> Key

Key of the set

-> a

Item to remove from the set

-> IO ()

No result

Remove an item from a redis set

setContainsSource

Arguments

:: Binary a 
=> Redis

Redis handle

-> Key

Key of the set

-> a

Item to check for

-> IO Bool

If the item is present in the set

Check if a set contains a certain item

setFindAllSource

Arguments

:: Binary a 
=> Redis

Redis handle

-> Key

Key of the set

-> IO [a]

All items in the set

Get all items from a set