cat

added
1.7

ns
clojure.core

type
function

(cat rf)

A transducer which concatenates the contents of each input, which must be a
collection, into the reduction.

                ;; cat is handy for untangling nested collections when using transducers

(into [] (comp cat cat (map inc)) [[[1] [2]] [[3] [4]]])
;; => [2 3 4 5]
            
                ;; Remove the need of (mapcat identity coll) idiom:
(def rota (sequence cat (repeat ["tom" "nick" "jane"])))
(nth rota 7) ; who's up next week?
;; nick