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

ajb at spamcop.net ajb at spamcop.net
Wed Mar 12 22:46:04 EDT 2008


G'day all.

Quoting David Menendez <dave at zednenem.com>:

> Adrian is arguing that compare a b == EQ should imply compare (f a) (f
> b) == EQ for all functions f (excluding odd stuff). Thus, the problem
> with your example would be in the Ord instance, not the sort function.

Understood, and the Schwartzian transform might be better understood as
"sortBy" rather than "sort".

As others have noted, this really is a question of what Eq and Ord
"mean".  And the answer to that is: Whatever makes the most
domain-specific sense.

Cheers,
Andrew Bromage


More information about the Haskell-Cafe mailing list