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

Neil Mitchell ndmitchell at gmail.com
Mon Mar 10 17:33:51 EDT 2008


Hi

>  (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]

Fortunately the Haskell sort is meant to be stable, and sorting is
meant to be a permutation, so we happily have the situation where this
has a correct answer: 2. Anything else is incorrect. Anyone submitting
a revised sort through the Haskell libraries process will have to
ensure the answer is 2. I hope someone does take the time to do this,
as a faster base library will benefit everyone.

Adrian: I think its fairly clear we disagree about these things.
However, we both understand the others point of view, so I guess its
just a question of opinion - and I doubt either of us will change. As
such I think any further discussion may just lead to sleep deprivation
[1]. I think I'm coming from a more discrete maths/theoretical
background while you are coming from a more practical/pragmatist
background.

Thanks

Neil

[1] http://xkcd.com/386/


More information about the Haskell-Cafe mailing list