We already made nub use Ord by default in #91, but there are a few other unnecessarily quadratic functions in this library still which probably deserve the same treatment. I think these are union, intersect, and difference.
As well as being quadratic, union and difference have a strange-seeming behaviour where duplicates are only preserved in the first argument:
union [0, 0] [1, 1] == [0, 0, 1]
See #56 for more info. We ought to be careful about changing this behaviour but I think we should consider it, since I think it’s very likely to trip people up and we will be making breaking changes to these functions anyway if we do this.
We already made
nubuse Ord by default in #91, but there are a few other unnecessarily quadratic functions in this library still which probably deserve the same treatment. I think these areunion,intersect, anddifference.As well as being quadratic,
unionanddifferencehave a strange-seeming behaviour where duplicates are only preserved in the first argument:See #56 for more info. We ought to be careful about changing this behaviour but I think we should consider it, since I think it’s very likely to trip people up and we will be making breaking changes to these functions anyway if we do this.