Skip to content

Instantly share code, notes, and snippets.

Created January 18, 2012 22:02
Show Gist options
  • Save anonymous/1636082 to your computer and use it in GitHub Desktop.
Save anonymous/1636082 to your computer and use it in GitHub Desktop.
;; ariarule's solution to Sequence Reductions
;; https://4clojure.com/problem/60
(fn my-reductions
([f c]
(my-reductions f (first c) (drop 1 c)))
([f i c]
(lazy-seq
(cons
i
(if (= c '())
nil
(my-reductions f (f i (first c)) (rest c)))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment