Skip to content

Instantly share code, notes, and snippets.

@bmorphism
Created February 21, 2015 02:01
Show Gist options
  • Save bmorphism/8031ea32b9b323386ee9 to your computer and use it in GitHub Desktop.
Save bmorphism/8031ea32b9b323386ee9 to your computer and use it in GitHub Desktop.
My solution to 4Clojure problem 60
(fn fun-times
([fun xs] (fun-times fun (first xs) (rest xs)))
([fun init xs] (lazy-seq
(if (seq xs)
(let [reduction (fun init (first xs))]
(cons init (fun-times fun reduction (rest xs))))
[init]
))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment