What is the best way to convert a list of Option[T] to a list of T where the option is not None? E.g. I want to go from this:
scala> val xs = Some(3) :: None :: Some(4) :: Some(5) :: None :: Nil xs: List[Option[Int]] = List(Some(3), None, Some(4), Some(5), None) to this:
List[Int] = List(3, 4, 5) in the most idiomatic way possible.