Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
4clojure #60
(fn reduction1
([f col]
(reduction1 f (f (first col)) (rest col)))
([f val col]
(if (empty? col)
(list val)
(cons val (lazy-seq (reduction1 f (f val (first col)) (rest col)))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment