(distinct) (distinct coll)
Returns a lazy sequence of the elements of coll with duplicates removed. Returns a stateful transducer when no collection is provided.
user=> (distinct [1 2 1 3 1 4 1 5])
(1 2 3 4 5)
user=> (def fractions
(for [n (range 1 100) d (range (inc n) 100)]
(let [gcd (clojure.contrib.math/gcd n d)]
(/ (/ n gcd) (/ d gcd)))))
;; all irreducible fractions with denominator < 100
;; (1/2 1/3 ... 1/99 2/3 1/2 2/5 1/3 ...)
user=> (count fractions)
4851
user=> (count (distinct fractions))
3003