hyperloglog (hackage): This package provides an approximate streaming (constant space) unique object counter.  See the original paper for details: http://algo.inria.fr/flajolet/Publications/FlFuGaMe07.pdf  Notably it can be used to approximate a set of several billion elements with 1-2% inaccuracy in around 1.5k of memory.
Keywords: bsd3|library|numeric