I love libraries like this and fn.py, and I really miss the things I've got used to having available in Haskell when I write python. It's possible to use function patterns in python (Applicative and Functor are things you can implement in any language). However given who is in charge of python and the way he feels about FP, I don't think python will ever be a decent functional programming environment:<p><pre><code> As long as I'm "in charge" the chances of this (or anything like it) being accepted into
Python are zero. I get a headache when I try to understand code that uses function
composition, and I end up having to laboriously rewrite it using more traditional
call notation before I move on to understanding what it actually does. Python is not
Haskell, and perhaps more importantly, Python users are not like Haskell users.
Either way, what may work out beautifully in Haskell will be like a
fish out of water in Python.
I understand that it's fun to try to sole this puzzle, but evolving Python is more than
solving puzzles. Enjoy debating the puzzle, but in the end Python will survive
without the solution.
</code></pre>
<a href="http://stackoverflow.com/questions/1017621/why-isnt-python-very-good-for-functional-programming" rel="nofollow">http://stackoverflow.com/questions/1017621/why-isnt-python-v...</a>
Between this an fn.py (<a href="https://github.com/kachayev/fn.py" rel="nofollow">https://github.com/kachayev/fn.py</a>), functional programming in Python has really good library support beyond the standard library.
That is not what stemming is at all. Stemming is going from "running" to "run", not "run!" to "run"<p><a href="http://en.m.wikipedia.org/wiki/Stemming" rel="nofollow">http://en.m.wikipedia.org/wiki/Stemming</a>
It seems to me that if you want functional programming, you choose a functional language. You don't (excuse my language) bastardize an OO language for it.
Tangential but ... could someone give me the name of the python library that made the front page last month and that "extends the standard lib" (itertools recipes, dates helper functions, etc)?
Can't find it using HN search.
Email in my profile. thks
It is sometimes hard to justify a dependency - many of toolz/fn.py/funcy functions are not hard to write manually.<p>The great thing about toolz is its <a href="https://github.com/pytoolz/cytoolz" rel="nofollow">https://github.com/pytoolz/cytoolz</a> counterpart which provides an optimized implementation of toolz. It is useful when you have a bottleneck in Python code - e.g. run several functions (functoolz.juxt), merge dictionaries (dicttooz.merge), etc. With cytoolz the code becomes prettier and faster, not only prettier, so it is easier for cytoolz to sneak in.
I love stuff like this, though I feel it makes the code actually harder to read because none of it's standardized and there are a variety of somewhat equivalent but not completely isomorphic libraries out there for functional programming in Python.
Does it have a recursive dictionary merge - something like merge({'a': {'b': 1}}, {'a': {'c': 2}}) -> {'a': {'b': 1, 'c': 2}} ?
Year old reddit thread<p><a href="http://www.reddit.com/r/Python/comments/1wrlji/" rel="nofollow">http://www.reddit.com/r/Python/comments/1wrlji/</a>