function | since v0.0-1236 | clojure.core.reducers/flatten | Edit |
(flatten)
(flatten coll)
Takes any nested combination of sequential things (lists, vectors, etc.) and returns their contents as a single, flat foldable collection.
(defcurried flatten
{}
[coll]
(folder coll
(fn [f1]
(fn
([] (f1))
([ret v]
(if (sequential? v)
(-reduce (flatten v) f1 ret)
(f1 ret v)))))))