Francesco Mazzoli <f...@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

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to