Created
April 17, 2009 04:43
-
-
Save pjb3/96861 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn foldr [f acc coll] | |
(if (first coll) | |
(f (first coll) (foldr f acc (rest coll))) | |
[])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With the change, it is a right-associative fold:
But it isn't lazy like Haskell fold: