title: Sum a list of options in Scala
body: <p>How can I sum a list of options <code>List[Option[Double]]</code> with the following rules?</p>
  
  <ul>
  <li><code>List(Some(1), ..., Some(n)) --&gt; Some(1 + ... + n)</code></li>
  <li><code>List(Some(1), ..., Some(n), None) --&gt; None</code></li>
  <li><code>List(None, ..., None) --&gt; None</code></li>
  </ul>