I wrote the following simple code:
import cats.effect.IO
import cats.instances.either._
import cats.syntax.TraverseSyntax
object Test extends App with TraverseSyntax{
val e: Either[String, IO[Int]] = Right(IO(2))
e.sequence //error here
}
Unfortunately it refuses to compile with the
Error:(25, 94) value sequence is not a member of scala.util.Either
Can you please explain why? I imported either
instances which include Traverse[Either[A, ?]]
. What's wrong?