[Haskell-cafe] The maximum/minimum asymmetry

Mario Blažević blamario at acanac.net
Mon Sep 5 18:22:10 CEST 2011


On 11-09-05 10:42 AM, Sjoerd Visscher wrote:
> This way these laws hold for non-empty lists:
>
> maximumBy f xs = last (sortBy f xs)
> minimumBy f xs = head (sortBy f xs)

     That's not a bad justification for the way implementation works, 
even if it's not the original reason behind it. I think these laws 
should be added to the Haddock documentation.




More information about the Haskell-Cafe mailing list