title: Cross product in Scala
body: <p>I want to have a binary operator <code>cross</code> (cross-product/cartesian product) that operates with traversables in Scala:</p>
  
  <pre><code>val x = Seq(1, 2)
  val y = List('hello', 'world', 'bye')
  val z = x cross y    # i can chain as many traversables e.g. x cross y cross w etc
  
  assert z == ((1, 'hello'), (1, 'world'), (1, 'bye'), (2, 'hello'), (2, 'world'), (2, 'bye'))
  </code></pre>
  
  <p>What is the best way to do this in Scala only (i.e. not using something like scalaz)?</p>