3 ms·
> (take 1000 (mapcat (fn [i] (repeat i (odd? i))) (range))) And this example is suppoed to support Clojure's readability?
by SkidanovAlex 11y ago
> (take 1000 (mapcat (fn [i] (repeat i (odd? i))) (range)))
And this example is suppoed to support Clojure's readability?
- j-pb 11y agoYou do it in a different language that isn't haskel or ml and show me the result, then we can judge. You'd btw probably write it as. (->> (range) (map #(repeat % (odd? %))) (apply concat) (take 1000) If you want it more readable.