I\'m doing a bit of Scala gymnastics where I have Seq[T] in which I try to find the \"smallest\" element. This is what I do right now:
Seq[T]
val leastOrNo
A safe, compact and O(n) version with Scalaz:
O(n)
xs.nonEmpty option xs.minBy(_.foo)