maxByOption

trait Collection[A] {
  def maxByOption[W](f: (A) => W): A
}

maxByOption applies f to each element and returns the element that yields the largest value wrapped with Some.

On empty collections this function returns None.