[Haskell-cafe] ordNub

Niklas Hambüchen mail at nh2.me
Sat Oct 12 21:12:13 UTC 2013


On 12/10/13 20:43, Anthony Cowley wrote:
> I think nub's behavior is rather set-related, so I don't really understand the objection to putting it in Data.Set.

In sets, the order does not matter, while for nub it does.

    nub    :: Eq a  => [a] -> [a]
    ordNub :: Ord a => [a] -> [a]

both do not mention Set, and the fact that Set is used inside my
proposed ordNub implementation is a detail not visible to the caller.

That's why it looks like a Data.List function to me.


More information about the Haskell-Cafe mailing list