Functional Programming with Python

Hi. This is my page about Functional Programming in Python. I've done a lot to use FP in my projects, and I've also tried to bring the wonder of functional programming to other Python programmers. The main culmination of that work is in a video series I made, published by O'Reilly, which you can buy here:

Functional Programming with Python

Functional Programming with Python

The description of the course, from that page:

In this Functional Programming with Python training course, expert author Chris Armstrong will teach you functional programming techniques for making maintainable, modular, and testable code. This course is designed for users that already have experience with Python.

You will start by learning about functional programming, including first class functions, recursion, and modifying data structures. From there, Chris will teach you about many functional programming libraries available in the Python ecosystem. This video tutorial will then teach you how to implement a text adventure game using these techniques and libraries. You will also learn how to write unit tests for functional code, use imperative libraries in a functional way, and use first-class effects. Finally, you will create a web UI for the game, and learn how to isolate an imperative web framework so that all of the application logic remains purely functional.

Once you have completed this computer based training course, you will have learned how to apply these functional programming techniques to create maintainable, modular, and testable Python code.

Libraries

I've also done a lot of work on libraries to allow us to do functional programming in Python.

  • Effect - purely functional effect tracking
  • sumtypes - sum types (aka tagged unions)

In addition to those, which I wrote, I also regularly use (and sometimes contribute to) these libraries, and strongly recommend them:

  • toolz - general purpose functional programming tools
  • pyrsistent - high-performance immutable data structures
  • hypothesis - generative/property-based testing