Andrew Coppin wrote:
It occurs to me that if you want a sorted list of only unique elements, it would seem (to me) to be efficient to do the sorting and the uniquing at the same time. Does any library function do this? (I imagine it wouldn't be hard to write it yourself...)
Yes, although it only works on instances of Ord then, because of the sorting.

Its actually quite a common idiom, and worth figuring out for yourself. Hint: look at "group".

Paul.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to