Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up[Question] Functional Programming Patterns #244
Comments
|
I'm a big fan of fp but although you can do it in Python, it is not always considered idiomatic. It's not a bad idea but I'm not sure if it's good to put it in this repo. I'd like to hear some thoughts from the rest of the community. |
As far as I know/learned until now some functional programming in Python is very pythonic. However these kind of patterns are more idioms than higher level patterns and not really suitable for the repo (due to low level). |
|
+1 for functional patterns here. @fkromer had you something particular in mind? I'll start proposing "pipeline" candidate |
|
I had the patterns addressed in S. Lott's "Functional Python Programming" in mind. In case you want to look into the book pay attention before doing so: There is a section about patterns and some references in the index but the majority of examples is spread over the whole book. It makes sense to depend on some Python package(s) which implement boilerplate required to implement the actual patterns. As @faif already said: I am not sure if it's a good idea to put this into here. Recently I started a small project called 30 seconds of functional python programming. Right now it's a collection of Python package API examples running in an interactive Python environment on Binder. Python packages for functional programming have been hardly addresses in the books I've looked into so far. The packages provide lowest level building blocks to adapt a FP style beyond what you can do with Pythons builtin and standard lib stuff. I think it's way more effective to learn new programming language features via exploratory experimentation. I've not pushed everything I've prepared so far but I will do so that you get a better understanding of what the project is aiming for. E.g. I'd like to port the JavaScript examples from Functional Programming Jargon to Python as well. And it would be reasonable to put pattern examples/implementations into specific Python package specific sections as well. Feel free to contribute there as well. |
Another higher level candidate: Parallel Functional Pipeline Pattern |
|
Perhaps this repo would be a better place to centralize functional programming pattens and concepts in Python. |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

Would you accept PRs about functional programming patterns @faif ? Would probably imply some project restructuring (e.g. putting dirs "behavioral" and "structural" into "oop").