On 4 March 2011 09:47, Karthick Gururaj <[email protected]> wrote:
> 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
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe