title: Get differences between members of a list
body: <p>I have a list of values and want to reduce it to a list of differences between successive members. Is there a better way than this I have come up with (Trivial example) ?</p>
  
  <pre><code>val l1 = List(1,2,3,4,5,6)
  
  val diffs = (l1 zip l1.drop(1)).map{case (x,y) =&gt; y - x}.sum
  </code></pre>