title: Min/max with Option[T] for possibly empty Seq?
body: <p>I'm doing a bit of Scala gymnastics where I have <code>Seq[T]</code> in which I try to find the "smallest" element. This is what I do right now:</p>
  
  <pre><code>val leastOrNone = seq.reduceOption { (best, current) =&gt;
      if (current.something &lt; best.something) current
      else best
  }
  </code></pre>
  
  <p>It works fine, but I'm not quite satisfied - it's a bit long for such a simple thing, and <a href="http://www.antiifcampaign.com/" rel="noreferrer">I don't care much for "if"s</a>. Using <code>minBy</code> would be much more elegant:</p>
  
  <pre><code>val least = seq.minBy(_.something)
  </code></pre>
  
  <p>... but <code>min</code> and <code>minBy</code> throw exceptions when the sequence is empty. Is there an idiomatic, more elegant way of finding the smallest element of a possibly empty list as an <code>Option</code>? </p>