Functional Programming in Python
Create a project folder on your local machine, if you haven't done so already. Clone this repository, create a virtual environment and install required packages.
$ mkdir python-fp
$ cd python-fp
$ virtualenv .env
(.env) $ source .env/bin/activate
(.env) $ pip install -r requirements.txt
Now, we need to start the jupyter notebook kernel, which will open your default web browser in the current directory and you will be able to interact with the nootebooks.
$ (.env) $ jupyter notebook
The exapmles and content within this repository aims to introduce beginner to intermediate level python programmers to the concepts of functional programming. Although python is not a functinoal programming language, you can still take a more functional approach to writing your code which will make it easier to maintain, and be interesting to leant at the same time.
Topics covered:
- OOP vs FP
- lambda expressions vs list comprehensions
- filter, map, reduce
- FP best practices
Helpful resources
- Toolz - https://github.com/suor/funcy/
- fn.py - https://github.com/kachayev/fn.py
- funcy - https://github.com/suor/funcy/