X Tutup
The Wayback Machine - https://web.archive.org/web/20201014201046/https://github.com/faif/python-patterns/issues/244
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Functional Programming Patterns #244

Open
fkromer opened this issue Sep 29, 2018 · 6 comments
Open

[Question] Functional Programming Patterns #244

fkromer opened this issue Sep 29, 2018 · 6 comments
Labels

Comments

@fkromer
Copy link
Contributor

@fkromer fkromer commented Sep 29, 2018

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

@faif
Copy link
Owner

@faif faif commented Sep 29, 2018

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.

@fkromer
Copy link
Contributor Author

@fkromer fkromer commented Sep 29, 2018

(...) although you can do it in Python, it is not always considered idiomatic.

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).

@faif faif added the question label Oct 5, 2018
@gyermolenko
Copy link
Contributor

@gyermolenko gyermolenko commented Feb 7, 2019

+1 for functional patterns here.

@fkromer had you something particular in mind?
We should probably make a list to briefly discuss it before actually implementing(or copying).

I'll start proposing "pipeline" candidate

@fkromer
Copy link
Contributor Author

@fkromer fkromer commented Feb 7, 2019

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.

@fkromer
Copy link
Contributor Author

@fkromer fkromer commented Feb 10, 2019

I'll start proposing "pipeline" candidate

Another higher level candidate: Parallel Functional Pipeline Pattern

@mpkocher
Copy link

@mpkocher mpkocher commented Jul 4, 2020

Perhaps this repo would be a better place to centralize functional programming pattens and concepts in Python.

https://github.com/sfermigier/awesome-functional-python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.
X Tutup