HORIZON HASKELLDocslts/ghc-9.14.x3e2d5682026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 3e2d568 · 2026-10-11

Modulehedis-0.16.4Haskell2010

Database.Redis.Core

  • 8 types
  • 2 classes
  • 8 values
  • Packagehedis-0.16.4
  • Exports18
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceInternal.hs
newtypenewtype 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.

Instances11Monad, Functor, MonadFail, Applicative, MonadIO, MonadCatch, …
valueunRedis :: Redis a -> ReaderT RedisEnv IO a
#

Deconstruct Redis constructor.

unRedis and reRedis can be used to define instances for arbitrary typeclasses.

WARNING! These functions are considered internal and no guarantee is given at this point that they will not break in future.

classclass MonadRedis m => RedisCtx (m :: Type -> Type) (f :: Type -> Type) | m -> f where
#

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.

Methods

Instances2RedisCtx
typetype SendHook = (ByteString -> IO ()) -> ByteString -> IO ()
#

A hook for sending raw bytes to the server.

This sits below request rendering and can be used to observe the exact wire payload sent on the socket.

valuesendRequest :: (RedisCtx m f, RedisResult a) => [ByteString] -> m (f a)
#

sendRequest can be used to implement commands from experimental versions of Redis. An example of how to implement a command is given below.

-- |Redis DEBUG OBJECT command
debugObject :: ByteString -> Redis (Either Reply ByteString)
debugObject key = sendRequest ["DEBUG", "OBJECT", key]
valuerunRedisInternal :: Connection -> Redis a -> IO a
#

Internal version of runRedis that does not depend on the Connection abstraction. Used to run the AUTH command when connecting.