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

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8174fa4 · 2026-10-11

Modulehedis-0.16.4Haskell2010

Database.Redis.Transactions

  • 3 types
  • 3 values
  • Packagehedis-0.16.4
  • Exports6
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceTransactions.hs
valuemultiExec :: RedisTx (Queued a) -> Redis (TxResult a)
#

Run commands inside a transaction. For documentation on the semantics of Redis transaction see http://redis.io/topics/transactions.

Inside the transaction block, command functions return their result wrapped in a Queued. The Queued result is a proxy object for the actual command's result, which will only be available after EXECing the transaction.

Example usage (note how Queued 's Applicative instance is used to combine the two individual results):

 runRedis conn $ do
     set "hello" "hello"
     set "world" "world"
     helloworld <- multiExec $ do
         hello <- get "hello"
         world <- get "world"
         return $ (,) <$> hello <*> world
     liftIO (print helloworld)
 
datadata Queued a
#

A Queued value represents the result of a command inside a transaction. It is a proxy object for the actual result, which will only be available after returning from a multiExec transaction.

Queued values are composable by utilizing the Functor, Applicative or Monad interfaces.

Instances4Monad, Functor, Applicative, RedisCtx
datadata TxResult a
#

Result of a multiExec transaction.

Constructors

Instances5Eq, Show, Generic, NFData, Rep
newtypenewtype RedisTx a
#

Command-context inside of MULTI/EXEC transactions. Use multiExec to run actions of this type.

In the RedisTx context, all commands return a Queued value. It is a proxy object for the actual result, which will only be available after finishing the transaction.

Instances6Monad, Functor, Applicative, MonadIO, MonadRedis, RedisCtx