persistent-redis-2.5.2.2: Backend for persistent library using Redis.

Safe HaskellNone
LanguageHaskell98

Database.Persist.Redis

Synopsis

Documentation

class MonadRedis m => RedisCtx (m :: * -> *) (f :: * -> *) | m -> f #

This class captures the following behaviour: In a context m, a command will return its result wrapped in a "container" of type f.

Please refer to the Command Type Signatures section of this page for more information.

Minimal complete definition

returnDecode

data Redis a :: * -> * #

Context for normal command execution, outside of transactions. Use runRedis to run actions of this type.

In this context, each result is wrapped in an Either to account for the possibility of Redis returning an Error reply.

Instances

Monad Redis 

Methods

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

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

return :: a -> Redis a #

fail :: String -> Redis a #

Functor Redis 

Methods

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

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

Applicative Redis 

Methods

pure :: a -> Redis a #

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

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

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

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

MonadIO Redis 

Methods

liftIO :: IO a -> Redis a #

MonadRedis Redis 

Methods

liftRedis :: Redis a -> Redis a #

RedisCtx Redis (Either Reply) 

data Connection :: * #

A threadsafe pool of network connections to a Redis server. Use the connect function to create one.

data PortID :: * #

Instances

Eq PortID 

Methods

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

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

Show PortID 

type RedisT = ReaderT Connection Source #

Monad reader transformer keeping Redis connection through out the work

withRedisConn :: (Monad m, MonadIO m) => RedisConf -> (Connection -> m a) -> m a Source #

Run a connection reader function against a Redis configuration

thisConnection :: Monad m => RedisT m Connection Source #

Extracts connection from RedisT monad transformer

execRedisT :: (Monad m, MonadIO m) => RedisTx (Queued a) -> RedisT m a Source #

Execute Redis transaction inside RedisT monad transformer