Functors in Haskell and C++
C++ is my language of choice for almost every project I do, not least for it's wide range of support language paradigms - OO, functional, generic etc. But I'd be the last person to say that it's a pretty language. Example: creating an object that will add 2 to a number:-
std::binder1st<std::plus<int> > binder= std::bind1st(std::plus<int>(),2);
Now compare this with Haskell
I haven't got very far with Haskell yet, I'm just trying to learn it to stretch my brain a bit, but this does highlight the hoops one has to jump to to make C++ behave like a functional language. That said, the boost people are making this easier with the boost::bind library, which I use a fair bit, and maybe the lambda library, though I haven't tried that yet.
I guess it's a testimony to the power of C++ that it can handle so many diverse paradigms, even if it isn't always pretty. And it can be taken far beyond what the original creators intended - witness what's been done with template meta-programming.
It also seem that the C++ compile-time language (i.e. template meta-programming) is a purely functional language, (see here, so we have this weird hybrid of a language that is OO and procedural at runtime, but functional at compile time. No wonder it takes so long to become truly skilled at using it.