title: Appending list of optional elements
body: <p>I need to make a sequence that, given a list containing optional list of strings, concatenates all of them to make a new list. This how my code looks like:</p>
  
  <pre><code>      res.foldLeft(Seq[Option[Seq[String]]]())((acc, v) =&gt; v match {
        case Some(x) =&gt; acc ++: Some(x)
        case None =&gt; acc
      })
  </code></pre>
  
  <p>where <code>res</code> is a list containing optional list elements such as :</p>
  
  <pre><code>List(Some(Seq(foo)), Some(Seq(bar)), None, Some(Seq(baz, blah)))
  </code></pre>
  
  <p>I get a compilation error at the sign <code>++:</code> saying:</p>
  
  <pre><code>  type mismatch; found : Iterable[Equals] required: Seq[Option[Seq[String]]]
  </code></pre>
  
  <p>What am I doing wrong here?</p>