I have one List[(A, Option[B])]. I would like to filter out all the tuples contained Nonein the second element, and then βexpandβ Optionby specifying List[A, B].
I am currently using this:
list.filter(_._2.isDefined).map(tup => (tup._1, tup._2.get))
Is there a better way (more concise)?
Ralph source
share