title: Scala generate unique pairs from list
body: <p>Input :</p>
  
  <pre><code>val list = List(1, 2, 3, 4)
  </code></pre>
  
  <p>Desired output :</p>
  
  <pre><code>Iterator((1, 2), (1, 3), (1, 4), (2, 3), (2, 4), (3, 4))
  </code></pre>
  
  <p>This code works :</p>
  
  <pre><code>for (cur1 &lt;- 0 until list.size; cur2 &lt;- (cur1 + 1) until list.size)
    yield (list(cur1), list(cur2))
  </code></pre>
  
  <p>but it not seems optimal, is there any better way of doing it ?</p>