Functional Programming

David Brown david at no.westcontrol.spam.com
Mon Dec 23 08:37:45 EST 2002


"beno" <zope at thewebsons.com> wrote in message
news:mailman.1040648131.3197.python-list at python.org...
> Hi;
> I've just completed *XSLT Programmer's Reference* (an excellent book on
the
> subject). For those familiar with this language, it relies on functional
> programming. The concept was new to me but appeals to me. I would like to
> practice functional programming in Python. I went to Amazon to look for
> books on the same and was disappointed none are written for Python;
rather,
> almost all are written for Haskell. Does anyone know of good sources of
> info for programming using the principles of functional programming in
> Python? Or, to what languages is Haskell similar? Any other advice on the
> subject equally welcomed!
> TIA,
> beno
>

Python is not a functional programming language, although it does have a
number of the key functional programming structures (functions as
first-class objects, lists, lambda, map, filter, reduce, zip, list
comprehensions).  You will find that some functional programming code can be
translated fairly directly into Python, but much (especially involving
complex data structures) is going to be difficult.

Why not get a book on Haskell and read about that?  Haskell is a pretty good
funcitonal programming language - it is relatively clear, there are free
compilers (GHC) and interpreters (HUGS), and plenty of on-line tutorials.
Even if you don't end up doing much real programming in Haskell, it is good
for your programming skills to learn some functional programming.






More information about the Python-list mailing list