I have a Map of String -> Foo and I want to get a sorted collection of Foos by Foo.priority:
fooMap.collect { case (k, f) if k.startWith("F") => f }.toSeq.sortBy(_.priority)
How can I avoid the intermediate toSeq? Can I create a new collection and insert by the ordering? Maybe something like:
fooMap.collect { case (k, f) if k.startWith("F") => f }.to[Seq](orderedCanBuildFrom) //does not work