<div dir="ltr">I think these are useful in general, and that they would make a good addition to `Data.Ord`. The names are inspired by `sortOn`. Definitions:<div><br></div><div>```</div><div>minOn :: Ord b => (a -> b) -> a -> a -> a</div><div>minOn f x y =</div><div>  case comparing f x y of</div><div>    LT -> x</div><div>    _ -> y</div><div><br></div><div>maxOn :: Ord b => (a -> b) -> a -> a -> a<br></div><div><div>maxOn f x y =</div><div>  case comparing f x y of</div><div>    GT -> x</div><div>    _ -> y</div></div><div>```</div><div><br></div><div>These don't need to be the exact definitions, but they convey the semantics I'm looking for.</div></div>