I want to have a binary operator cross (cross-product/cartesian product) that operates with traversables in Scala:
cross
val x = Seq(1, 2) val y = Lis
Alternative for cats users:
sequence on List[List[A]] creates cross product:
sequence
List[List[A]]
import cats.implicits._ val xs = List(1, 2) val ys = List("hello", "world", "bye") List(xs, ys).sequence //List(List(1, hello), List(1, world), List(1, bye), List(2, hello), List(2, world), List(2, bye))