
11 Jul
2009
11 Jul
'09
9:06 a.m.
Hi, I see the type of the List.sort function is: Ord a => [a] -> [a] I don't understand how this type can allow it to sort pairs: Prelude> :m +List Prelude List> sort [(1, "1"), (3, "3"), (2, "2")] [(1,"1"),(2,"2"),(3,"3")] How can a pair by of type "Ord a"? Is it a rule that the first element is automatically used? Patrick -- ===================== Patrick LeBoutillier Rosemère, Québec, Canada