[Haskell-cafe] Re: (flawed?) benchmark : sort

Krzysztof Skrzętnicki gtener at gmail.com
Mon Mar 10 17:39:51 EDT 2008


On Mon, Mar 10, 2008 at 10:13 PM, Adrian Hey <ahey at iee.org> wrote:

>
> (sort [a,b]) in the case we have: (compare a b = EQ)
>
> Which of the following 4 possible results are correct/incorrect?
> 1- [a,a]
> 2- [a,b]
> 3- [b,a]
> 4- [b,b]


I'd say 2 and 3 are sane, while 2 is correct - because we need stable sort.
Stable - this is the keyword!
If `==` would mean identity then we wouldn't need a stable sorting
algorithm.


Christopher Skrzętnicki
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080310/d5503f1f/attachment.htm


More information about the Haskell-Cafe mailing list