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
In Haskell you'd wrap the minimumBy call as
least f x | Seq.null x = Nothing | otherwise = Just (Seq.minimumBy f x)