foldr f z [] = z
foldr f z (x:xs) = f x (foldr f z xs)
Clojure does it like this (note the overloading - this is both "foldl" and "foldl1" in Haskell terms): http://github.com/richhickey/clojure/blob/49a7d6b8e14050a45d...r' f (x:xs) | xs == [] = (f x):[] | otherwise = (f x):(r' f xs)
or:
[(f a) | a <- myList]
- another edit -
r' f (x:xs) | xs == [] = x | otherwise = f x (r' f xs)
(and the fact that everybody who hasn't implemented a tautologous reduce has basically used the same tail-recursive algorithm lends a bit more support to this theory)
The more I think about it, it's just another expression of the old "when all you have is a hammer" aphorism. Guido's being yelled at and called names not because he's wrong or because he's stupid or doesn't understand what he's talking about, he's being yelled at and called names because the "hammer" in this case -- functional programming -- is a bit of a sacred cow, and a lot of people get really defensive about it.
Of course all functional programmers write the same tail-recursive implementation of "reduce." That's like observing that everyone uses a loop to implement "reduce" in an imperative language. It's the simple, straightforward way to do it. (And since folds are trivially implemented in any functional language with tail recursion, why would the language designer include them as a primitive?)
It's also very common in Haskell to implement your own fold for various reasons. For example, in a simple 50-line text processing script[1], I defined a fold for a list-of-trees data structure without calling any builtin fold function[2].
[1]: http://github.com/mbrubeck/outline-grep
[2]: http://github.com/mbrubeck/outline-grep/blob/master/OutlineG...
P.S. I like your blog, and huge thanks for Django!