(defn unique
"Deprecated - this function will be removed. Use transducer instead"
{:deprecated "0.1.319.0-6b1aca-alpha"}
([ch]
(unique ch nil))
([ch buf-or-n]
(let [out (chan buf-or-n)]
(go (loop [last nil]
(let [v (<! ch)]
(when (not (nil? v))
(if (= v last)
(recur last)
(do (>! out v)
(recur v))))))
(close! out))
out)))