[Haskell-cafe] ordNub

Ketil Malde ketil at malde.org
Tue Jul 16 14:46:33 CEST 2013


Francesco Mazzoli <f at mazzo.li> writes:

>> import qualified Data.HashSet as S
>> 
>> nub :: Hashable a => [a] -> [a]
>> nub = S.toList . S.fromList

> Well, the above is not stable while Niklas’ is.  But I guess that’s not
> the point of your message :).

We could also implement Data.BloomFilter.nub, which removes equal
elements probabilistically (with a small but non-zero chance of removing
some unique elements) :-)

-k
-- 
If I haven't seen further, it is by standing in the footprints of giants




More information about the Haskell-Cafe mailing list