Great argument as to why C++, though it works for functional programming in some technical sense, is far less than ideal.
> You might have to pass -ftemplate-depth-1024 to g++ to get this compiled.
Yeah, no kidding. Semantic arguments aside, this made my head hurt, and I've actually done a reasonable amount of C++ programming.
For comparison, here are what Church numerals look like in Clojure, another language that (like Haskell) has first-class higher order functions:
(defn church [n]
(cond (= n 0) (fn [f x] x)
(> n 0) (fn [f x] (f ((church (dec n)) f x)))))
(defn unchurch [n]
(n inc 0))
And it works at runtime.