Does Scala have an API method that converts a Seq[Option[T]] to Seq[T]?

Viewed 10237

Is there a Scala API method to convert a Seq[Option[T]] -> Seq[T]?

You can do this manually via:

seq.filter(_.isDefined).map(_.get)

Wondering if there is a method that does the above in the general API.

1 Answers
Related