Awesome Functional Python
A curated list of awesome things related to functional programming in Python.
Official documentation
- Functional Programming HOWTO - "In this document, we’ll take a tour of Python’s features suitable for implementing programs in a functional style".
Books
Free books / ebooks
- Functional Programming in Python by David Mertz (O'Reilly)
Non-free books
- Functional Python Programming, by Steve Lott (Packtpub, 2015)
- Python Reactive Programming, by Dag Brattli (Packtpub, 2017 - preorder)
Talks
Introductory
- Functional Programming with Python (slides), Alexey Kachayev, UA PYCon 2012.
- Purely Functional Programming in Python: Pure Fun (slides), Christopher Armstrong, PyTenessee 2015.
- Functional Programming with Python (video), Mike Müller, PyCon US 2013.
Advanced or specialized
- Functionalish programming in Python with effect (video), Robert Collins, NZ PyCon 2015.
- Monadic Parsing in Python (slides), Alexey Kachayev, KyivPy 2014.
- Immutability and Python - Introducing Pyrsistent (slides), Tobias Gustafsson, 2014.
- Understanding Transducers (slides, video), Austin Bingham, PyCon Belarus 2015.
Data science oriented
- Functional Performance with Core Data Structures (video), Matthew Rocklin, PyData SV 2014.
- Old School - Functional Data Analysis (video), Matthew Rocklin, PyData NYC 2013.
- Learning Data Science Using Functional Python (video, slides), Joel Grus, PyData Seattle 2015.
Other resources
Video lectures
- Functional Programming with Python, by Christopher Armstrong, O'Reilly.
Blog posts
- Origins of Python's "Functional" Features, Guido Van Rossum, 2009.
- A practical introduction to functional programming (with examples in Python), by Mary Rose Cook (year unknown).
- Immutable data structures in Python, Robert Rees, 2014.
- Understanding Transducers through Python, by Robert Smallshire. "In this 8 parts series we take an in-depth look at transducers. Transducers – a portmanteau of ‘transform reducers’ – are a new functional programming concept introduced into the Clojure programming language."
- Thinking Functionally with Python and Django at eShares Inc., Kyle Hanson, 2017.
Scientific papers
- Practical Functional Reactive Programming (PDF), John Peterson, Ken Roe, and Alan Cleary, 2014.
Libraries
General
- toolz ★1500 - "A functional standard library for Python".
- funcy ★1300 - "A fancy and practical functional tools".
- fn.py ★2100 - "Functional programming in Python: implementation of missing features to enjoy FP" (unmaintained since 2014).
- hask ★500 - "Haskell language features and standard libraries in pure Python".
- PyFunctional ★390 - "Python library for functional programming with collections in a data pipeline style".
- Effect ★200 - "Effect isolation in Python, to facilitate more purely functional code".
- Pydash ★160 - "The kitchen sink of Python utility libraries for doing "stuff" in a functional way. Based on the Lo-Dash Javascript library".
- Underscore.py ★220 - "A Python port of excellent javascript library underscore.js".
- pyramda ★30 - "Python package supporting heavy functional programming through currying. Translation of the Ramda library from javascript to python".
- PyMonad - "a small library implementing monads and related data abstractions -- functors, applicative functors, and monoids -- for use in implementing functional style programs".
- Amino - "functional data structures and type classes".
Immutable / persistent data structures
- Pyrsistent ★500 - "Persistent/Immutable/Functional data structures for Python".
- Funktown ★60 - "Immutable Data Structures for Python".
- Discodb ★50 - "An efficient, immutable, persistent mapping object".
- Pysistence - "Pysistence is a project that seeks to make functional programming in python easier".
Other / specialized
- Transducers - "This is a port of the transducer concept from Clojure to Python, with an emphasis on providing as Pythonic as interpretation of transducers as possible, rather than reproducing Clojurisms more literally".
- Tranducers-Python - "Transducers are composable algorithmic transformations".
- RxPy - "Reactive Extensions for Python".
- python-lenses - "A python lens library for manipulating deeply nested immutable structures".
Languages
Functional programming languages that are not Python but are related to the Python ecosystem:
- Hy - "A dialect of Lisp that’s embedded in Python".
- Coconut - "Simple, elegant, Pythonic functional programming".
- Mochi - "A dynamically typed programming language for functional programming and actor-style programming.".
- Tydy - "Tydy is a statically typed, functional-first programming language in the ML tradition. tydy is an implementation of Tydy as a Python library."
- dg (aka dogelang) - "A programming language that compiles to CPython bytecode, much like Scala compiles to JVM's. That essentially means that dg is an alternative syntax for Python 3."
- pixie - "A lightweight and native lisp built in RPython". (Discussion on HN)
- Pycket - "A rudimentary Racket implementation using RPython".
- (How to Write a (Lisp) Interpreter (in Python)) and (An ((Even Better) Lisp) Interpreter (in Python)) - a couple of famous articles by Peter Norvig.