Returns the result of applying concat to the result of applying map
to f and colls. Thus function f should return a collection.
user=> (mapcat (fn [[k v]]
(for [[k2 v2] v]
(concat [k k2] v2)))
'{:a {:x (1 2) :y (3 4)}
:b {:x (1 2) :z (5 6)}})
((:a :x 1 2) (:a :y 3 4) (:b :x 1 2) (:b :z 5 6))
(defn mapcat
"Returns the result of applying concat to the result of applying map
to f and colls. Thus function f should return a collection."
{:added "1.0"
:static true}
[f & colls]
(apply concat (apply map f colls)))
Comments top
No comments for mapcat. Log in to add a comment.