I do agree that C++'s STL is sometimes too verbose.<p>It's important to be generic, but it'd have been great if the most common conveniences were added as well to make it pleasant to use. E.g.: erase remove idiom, count but no contains, specifying begin() and end() even when you mean the whole container, ... Anything where you need to type the variable name of your container more than once to do one operation on it.<p>Not just the containers and stl algorithms have that annoyance, but also the string stream operators to convert numbers to strings, this is way too verbose imho.<p>At least the new initializer lists make some things way more compact and convenient now :)
I think going this way is going to turn out painful. The sort of immutable container logic that people associate with FP is against the nature of C++ and you'll be constantly bumping into other people's code, and parts of the library, that don't like it.<p>C++ style prefers<p><pre><code> for_each(xs.begin(), xs.end(), f);
</code></pre>
to<p><pre><code> xs = std::transform(xs,f);
</code></pre>
Because the first does not copy the container and its elements, which in C++ is a meaningful operation which may not be allowed for xs's elements, or may be remarkably expensive.<p>I thought the annoying verbosity when using the whole container with <algorithm> was fixed in C++11 like it was for for loops, but I can't find documentation to that effect. Boost's range algorithms library is still useful here:<p><a href="http://www.boost.org/doc/libs/1_52_0/libs/range/doc/html/index.html" rel="nofollow">http://www.boost.org/doc/libs/1_52_0/libs/range/doc/html/ind...</a>
I was a little bit afraid to read this one. I've glanced at some of the functional patterns in the STL — function objects, ugh — and come away shaking my head.<p>But despite my problems with C++ and/or the STL, I really appreciated this piece. The author seems to know his stuff pretty well, as there are references to Haskell, monoids, laziness, as well as a brief discussion of performance.<p>It's probably too much to hope that this will win terribly many converts, but hey, what do I know?
I've recently discovered the delights of <algorithm>... now if I could just figure out how to bind member functions in my build environment (Solaris) I'd be a very happy man.