[Haskell-cafe] ordNub
Roman Cheplyaka
roma at ro-che.info
Sat Oct 12 21:18:45 UTC 2013
* Anthony Cowley <acowley at seas.upenn.edu> [2013-10-12 15:43:57-0400]
>
> On Oct 12, 2013, at 2:47 PM, Niklas Hambüchen <mail at nh2.me> wrote:
> >
> > I would like to come back to the original question:
> >
> > How can ordNub be added to base?
> >
> > I guess we agree that Data.List is the right module for a function of
> > type Ord a => [a] -> [a], but this introduces
> >
> > * a cyclic dependency between Data.List and Data.Set
> > * a base dependency on containers.
> >
> > What is the right way to go with that?
> >
> > Should ordNub be introduced as part of Data.Set, as Conrad suggested?
> >
> > It does not really have anything to do with Set, apart from being
> > implemented with it.
>
> I think nub's behavior is rather set-related, so I don't really
> understand the objection to putting it in Data.Set.
It's not Set (in the data structure sense) related. It's list-related,
because it clearly acts on lists.
Therefore, it belongs to Data.List.
Besides, we already have the precedent of the slow nub being in
Data.List.
Roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20131013/d8d31dd9/attachment.sig>
More information about the Haskell-Cafe
mailing list