If I have a List[Try[A]]
in Scala, what is the idiomatic way to filter out the Failure(t)
values?
One way is to use the following:
val someList: List[Try[String]] = ...
someList.filter(_.isFailure)
Is there a more "idiomatic" way, e.g. using flatten
? This does seem pretty simple.