
16 Jul
2013
16 Jul
'13
8:46 a.m.
Francesco Mazzoli
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