Mojo
Mojo

Reputation: 1202

Missing Implicit for Log Cats.Effect.IO

I am trying to get this simple example running using the redis4cats library:

import cats.effect._
import cats.implicits._
import dev.profunktor.redis4cats.Redis
import dev.profunktor.redis4cats.effect.Log.noop

object QuickStart extends IOApp {

  override def run(args: List[String]): IO[ExitCode] =
    Redis[IO].utf8("redis://localhost").use { cmd =>
      for {
        _ <- cmd.set("foo", "123")
        x <- cmd.get("foo")
        _ <- cmd.setNx("foo", "should not happen")
        y <- cmd.get("foo")
        _ <- IO(println(x === y)) // true
      } yield ExitCode.Success
    }

}

I have put in my build definition the follows:

libraryDependencies += "dev.profunktor" %% "redis4cats-effects" % Version libraryDependencies += "dev.profunktor" %% "redis4cats-log4cats" % Version

where version is 0.10.0-RC2

But when I compile I get:

could not find implicit value for evidence parameter of type dev.profunctor.redis4cats.effect.Log[cats.effect.IO]

what am I missing here? This is straight from the README here

https://redis4cats.profunktor.dev/

Upvotes: 0

Views: 536

Answers (1)

user3248346
user3248346

Reputation:

Add this:

  implicit val log : Log[IO] = Log.NoOp.instance

Upvotes: 3

Related Questions