relude
relude copied to clipboard
sortNub could be lazier
Most other nubbing functions are as lazy as possible, but sortNub
takes O(n log n)
time to produce the first element when it can be done in O(n)
. I'd expect there to be a version that's lazier.
lazySortNub xs = [x | x : _ <- group (sort xs)]