Wednesday, January 17, 2018

Clojure: flatten implementation

((fn flat [s] (if (sequential? s) (mapcat flat s) [s])) '((1 2) 3 [4 [5 6]]))
(1 2 3 4 5 6)