For comprehension requires withFilter
to destructure tuples, though it looks natural to use this with any values.
import cats._
import cats.implicits._
val v = for {
(a, b) <- (1, 2).asRight[String] // Error value withFilter is not a member of Either[String, (Int, Int)]
} yield a + b
Below is a workaround using an intermediate value (though it is still possible to use ._1, ._2 values)
import cats._
import cats.implicits._
val v = for {
result <- (1, 2).asRight[String]
(a, b) = result
} yield a + b