slavaGanzin/ramda.py

`use_with` fails if one of the transformers is a `lambda` function

Closed this issue · 2 comments

The following test case is failing:

def test_use_with():
    def add(x, y):
        return x + y

    two = R.use_with(R.add, [lambda x: x, R.identity])(1, 1)
    assert two == 2

probably because the current implementation of use_with is expecting named functions as transformers.
This wouldn't be so bad if not for e.g. pipe returning a lambda function that cannot be used as a transformer.

PS: @slavaGanzin coming back to python after a year in javascript land where I learned to love fp in general and ramda in particular, I am incredibly grateful for the work you have done here!

Nice work, Jakob. Thanks for your time.

Added you as a collaborator, it's not binding. I just found it's easier to push changes directly to repo and not to one's fork.

PS: @slavaGanzin coming back to python after a year in javascript land where I learned to love fp in general and ramda in particular, I am incredibly grateful for the work you have done here!

Yeah, understand you really well. I was really frustrated to dance all the python dances when I need to preprocess my data before doing ML. And as you know, nobody does ML in JavaScript... So, it was faster for me to reimplement ramda.

published in 0.6.1

Yeah, understand you really well. I was really frustrated to dance all the python dances when I need to preprocess my data before doing ML. And as you know, nobody does ML in JavaScript... So, it was faster for me to reimplement ramda.

Haha, I can see how that happened. I going down the same road right now.

Added you as a collaborator, it's not binding. I just found it's easier to push changes directly to repo and not to one's fork.

I'll gladly accept the invitation, thanks!