Scala Partition/Collect Usage
collect (defined on TraversableLike and available in all subclasses) works with a collection and a PartialFunction. It also just so happens that a bunch of case clauses defined inside braces are a partial function (See section 8.5 of the Scala Language Specification [warning – PDF]) As in exception handling: try { … do something risky … Read more