3 ms·
It's a neat trick, but why not just use Haskell? IMO, point free style is hard enough to understand in Haskell code, where it's used all the time and I'm expec
by jlarocco 15y ago
It's a neat trick, but why not just use Haskell?
IMO, point free style is hard enough to understand in Haskell code, where it's used all the time and I'm expecting to see it. Coming across it in Python, where I'm not expecting it, would probably take me an hour just to figure out what you were trying to do.
- adrusi 15y agoyeah, I agree, use python in the way it was meant to be used. If you're dying in python because it's not as cool as Haskell, but you need to use some existing python code, it's not that hard to run a Haskell program as a child process of python or vice-versa. Besides, you're not able to do all the point free stuff in python, you can't partially apply an infix function (there is no `map((+2), [1, 2, 3])`.
- iclelland 15y agoYou can, it just looks like this: map(functools.partial(operator.add,2), [1, 2, 3])