(def xf (filter keyword?))
Apply to a collection, returning a sequence:
(sequence xf [:a 1 2 :b :c]) ;; => (:a :b :c)
Apply to a collection, reducing the resulting collection with another function:
(transduce xf str [:a 1 2 :b :c]) ;; => ":a:b:c"
Apply to a collection, and conj
the result into another collection:
(into [] xf [:a 1 2 :b :c]) ;; => [:a :b :c]
Create a core async channel that uses a transducer to filter messages:
(require '[clojure.core.async :refer [chan >!! <!! poll!]])
(doseq [e [:a 1 2 :b :c]] (>!! ch e))
(<!! ch) ;; => :a
(<!! ch) ;; => :b
(<!! ch) ;; => :c
(poll! ch) ;;=> nil