
12 Mar
2008
12 Mar
'08
10:46 p.m.
G'day all.
Quoting David Menendez
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