haskellfunctional-programmingocamlboost-lambdaboost-phoenix

What functional language approach most readily transfers to Boost Phoenix?


I am looking to learn functional programming with an am to integrate Boost.phoenix into my project.

What language is most similar so that I can find books that will illustrate functional programming concepts in a way that can be readily applies in that context... Are haskell and ocaml similar?

ALternately are there any good functional programming books written in general terms that can be applied to Boost.phoenix?


Solution

  • I don't have any experience with Phoenix (I've skimmed the docs), but I do have some with C++, OCaml, and Haskell so I may be able to help there.

    First off, if you learn functional programming you'll find it doesn't translate prettily to C++ - it ends up messier and more verbose than if done in an actual functional language. Nevertheless, it is still worth learning the techniques as they will give you more tools and a different mindset.

    Are haskell and ocaml similar?

    They are both influenced by ML so they are quite similiar (well, sorta, see the comments). OCaml is closer to C++ because of it's imperative and OO features, but I recommend you learn Haskell as it is more functional, more mindbending, and has more resources. An interesting thing about ML-like languages that they translate quite nicely to template metaprogramming.

    ALternately are there any good functional programming books written in general terms that can be applied to Boost.phoenix?

    The docs of Phoenix seem to use fairly standard terms. The one thing which could be confusing is their use of the word 'functor' - in C++ it means function object but in languages like Haskell it is something else.

    Here are a few terms that you should look for:

    Here are two free books which I recommend reading as they are a great introduction to functional programming:

    http://learnyouahaskell.com/chapters (Haskell)

    http://mitpress.mit.edu/sicp/full-text/book/book.html (Scheme)