Proposal: Add Data.List.sortNub and sortNubBy

Neil Mitchell ndmitchell at gmail.com
Tue Mar 13 07:12:40 EDT 2007


Hi

> this is only an *implementation* dependency and it's ok as long as
> base includes both modules. if sometime in future situation will
> change, we can change implementation without boring users

Yes, the main question here is should the functions be included in the
Data.List module. If the answer is yes, how we implement them is
almost an irrelevancy, provided they satisfy the invariants we
specify.

I more meant that I suspect that Data.Set imports Data.List
transitively (although I do not know, its just a suspicion). If this
is the case, then the implementation would either require chunks to be
restructured, or recursively dependant modules (within the package)
would exist. It is Haskell 98, but it is not fun :)

Christian's mergesort idea is probably fast and doesn't require
painful dependencies. Of course only benchmarks prove fast, so I'll
benchmark whatever comes up at the end of the day.

As for Stefan's ordNub, I think it is a great idea to add along with
sortNub - this really does give people a nicer set of Nub functions.
My only worry is that the dependency on State and Set will make the
implementation have cyclic dependency fun.

Thanks

Neil


More information about the Libraries mailing list