title: How to transform Scala collection of Option[X] to collection of X
body: <p>I'm starting to explore Scala, and one of the things I'm intrigued by is the <code>Option</code> type and the promise of being able to eliminate <code>null</code> related errors.</p>
  
  <p>However I haven't been able to work out how to transform a list (or other collection) of, say, <code>Option[String]</code>, to a collection of <code>String</code> (obviously filtering out any values that are <code>None</code>).</p>
  
  <p>In other words, how do I get from this:</p>
  
  <pre><code>List[Option[Int]] = List(Some(1))
  </code></pre>
  
  <p>... to this:</p>
  
  <pre><code>List[Int] = List(1)
  </code></pre>
  
  <p>I'm using Scala 2.8 if that has any impact on the answer.</p>