Traverse over the left side of the structure.
Traverse over the left side of the structure.
For the right side, use the standard traverse
from cats.Traverse.
Example:
scala> import cats.implicits._ scala> val intAndString: (Int, String) = (7, "test") scala> intAndString.leftTraverse(i => Option(i).filter(_ > 5)) res1: Option[(Int, String)] = Some((7,test)) scala> intAndString.leftTraverse(i => Option(i).filter(_ < 5)) res2: Option[(Int, String)] = None