cljs.spec.test/distinct-by

MOVED, please see cljs.spec.test.alpha/distinct-by
functionremoved v1.9.542added v1.9.183Edit
(distinct-by f coll)

Source code @ clojurescript:src/main/cljs/cljs/spec/test.cljs
(defn distinct-by
  ([f coll]
   (let [step (fn step [xs seen]
                (lazy-seq
                  ((fn [[x :as xs] seen]
                     (when-let [s (seq xs)]
                       (let [v (f x)]
                         (if (contains? seen v)
                           (recur (rest s) seen)
                           (cons x (step (rest s) (conj seen v)))))))
                    xs seen)))]
     (step coll #{}))))