
4 Mar
2011
4 Mar
'11
10:50 a.m.
On 4 March 2011 09:47, Karthick Gururaj
I'm not able to still appreciate the choice of the default ordering order,
I don't know if this will help you appreciate the default or not, but just to say this default is concordant with the auto-derived Ord instances. data Tuple3 a b c = Tuple3 a b c deriving (Eq,Ord,Show) ghci> sort [Tuple3 1 2 4, Tuple3 1 2 3, Tuple3 2 1 1, Tuple3 1 3 5] [Tuple3 1 2 3,Tuple3 1 2 4,Tuple3 1 3 5,Tuple3 2 1 1] ghci> sort [(1,2,4), (1,2,3), (2,1,1), (1,3,5)] [(1,2,3),(1,2,4),(1,3,5),(2,1,1)] No surprises here. Just another place where we have the lexicographic ordering by default. HTH, -- Ozgur Akgun