import cats.Show
import cats.implicits._
import cats.effect._
import redis4s.free.RedisIO
import RedisIO.client
object Example extends IOApp {
override def run(args: List[String]): IO[ExitCode] = {
val operations: RedisIO[(Option[String], Option[String])] =
client.set("foo", "bar") *>
client.set("bar", "baz") *>
(client.get("bar") product client.get("foo"))
Redis4s[IO]
.use { session =>
session.run(operations) >>= putStrLn
}
.as(ExitCode.Success)
}
def putStrLn[A: Show](a: A): IO[Unit] = IO(println(a.show))
}
Purely functional Redis driver
License
redis4s/redis4s
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Purely functional Redis driver
Topics
Resources
License
Stars
Watchers
Forks
Releases
No releases published