title: Is there any difference between flatten and flatMap(identity)?
body: <pre><code>scala&gt; List(List(1), List(2), List(3), List(4))
  res18: List[List[Int]] = List(List(1), List(2), List(3), List(4))
  
  scala&gt; res18.flatten
  res19: List[Int] = List(1, 2, 3, 4)
  
  scala&gt; res18.flatMap(identity)
  res20: List[Int] = List(1, 2, 3, 4)
  </code></pre>
  
  <p>Is there any difference between these two functions? When is it appropriate to use one over the other? Are there any tradeoffs?</p>