title: How to implement `append[A](x: List[A], y: List[A]): List[A]` in tail-recursive version?
body: <p>Here is a recursive version of <code>append</code> for two lists:</p>
  
  <pre><code>def append[A](x: List[A], y: List[A]): List[A] = x match {
    case Nil =&gt; y
    case h :: t =&gt; h :: append(t, y)
  }
  </code></pre>
  
  <p>How to convert it to tail-recursive version?</p>