News for hackers. Stuff that matters.
Re:Reducers, transducers and core.async in Clojure by bad_user on Wednesday June 07, 2017 @04:14PM (#14509516)
> perpetuates the idea that Python won't let you write elegant and stateless programs that behave in a functional manner

Well, in my opinion Python really does not let you write elegant and stateless programs that behave in an FP manner.

The sample you've chosen in particular is all fine, except that `lambda` expressions are almost never used, due to Python not being expression oriented, so there isn't much you can express with a `lambda`.

You might find your `for x in seq if even(x)` expression elegant, but it is preceded by a `return`. Python is a statement / side effects oriented language and even in your one liner, it shows.

Oh, and given that a Python "generator" is like Java's Iterable / Iterator, that's not FP either, although you can argue that the mutation can be localized (e.g. in your `sum` example), but you have to be careful about it.

And if you'll take a look at the whole Python ecosystem, there's not much FP in it to be honest. I mean, seriously, out of all the mainstream languages, I can't think of a worse language to do FP than Python, except for C maybe,

Re:Reducers, transducers and core.async in Clojure by merlincorey on Wednesday June 07, 2017 @06:48PM (#14510465)
Check out toolz[0] for a Clojure inspired FP toolkit in Python.

[0] http://toolz.readthedocs.io/en/latest/