title: What's the difference between ::: and ++ for Lists?
body: <p>Given two lists <code>a</code> and <code>b</code>, what's the difference between <code>a ::: b</code> and <code>a ++ b</code>? I suspected one of these operators would simply call the other, but in fact, the implementations look completely different:</p>
  
  <pre><code>def :::[B &gt;: A](prefix: List[B]): List[B] =
    if (isEmpty) prefix
    else if (prefix.isEmpty) this
    else (new ListBuffer[B] ++= prefix).prependToList(this)
  
  override def ++[B &gt;: A, That](that: GenTraversableOnce[B])
                        (implicit bf: CanBuildFrom[List[A], B, That]): That = {
    val b = bf(this)
    if (b.isInstanceOf[ListBuffer[_]])(this ::: that.seq.toList).asInstanceOf[That]
    else super.++(that)
  }
  </code></pre>
  
  <p>From a usage perspective, should I prefer <code>a ::: b</code> or <code>a ++ b</code>? From an implementation perspective, is there a specific reason why one of these operators doesn't simply call the other?</p>