Suppose I have x :: [(n, a)]
where n is a number and a is an unorderable item (is not of class Ord).
I want to sort this list by n.
I cannot do sort x
because a
is not orderable. I can replace a
by indices and then assemble the new list using !!
but this seems like a poor solution.
Alternatives?