selfrefactor/rambda

Curry style

danrspencer opened this issue · 5 comments

We were looking at using Rambda instead of Ramda because of the speed, size and complexity benefits but we weren't huge fans of the current Curry implementation.

We liked that you say you're currying at call rather than implementation because it removes the ambiguity over whether the function you were calling is curried or not, but disliked that you have to change the interface of the original function to support it.

Is there a specific reason you went with this implementation rather than something like:

https://gist.github.com/danrspencer/a81fd5702d7d565c470b1566453f71a7

?

Thank you for taking the time to file the issue.

I tried to explain myself here https://ilearnsmarter.wordpress.com/2018/12/20/argumentation-of-rambdas-partialcurry-method/

Rambda's curry is not used internally, but you are fully right that it is not a good sign to change so much the interface of curry.

So I will file this issue as enhancement and I will replace current Ramda's curry with your suggestion and move this custom curry implementation to Rambdax.

Update:

Your suggested example does not work when using Ramda original curry https://goo.gl/JTPJTZ
So do you want Rambda curry to work as Ramda or to pass the example expectations?

My thoughts came about from me misunderstanding how Rambda's currying works when I first started trying to use it. I wasn't expecting it to work like Ramda's.

As I said I quite like the fact that Rambda's currying is done at call time rather than during the implementation of a function, it felt more open / obvious but didn't realise at first that it was based on using objects as parameters.

I hadn't actually seen your blog post so I was mostly asking for your rational for choosing that implementation (might be worth linking to it in your documentation about curry?).

I do wonder if both styles of function (the one I proposed and your original one) are actually slightly disingenuous being called curry, as what they're really doing is partial application? (https://medium.com/javascript-scene/curry-or-partial-application-8150044c78b8)

I realise that's more of a ramble than a direct answer. I think both versions of the Rambda curry function have value. Maybe the solution is to have both but not call them curry so as to avoid confusion with Ramda's implementation?

Ok, now I have a clearer view.

I will go and implement Rambda's curry to work as Ramda's curry does, thus I will ignore your example.
This way one can easily switch from Rambda to Ramda without much hustle.

Current Rambda's curry will be renamed to partialCurry and I will link to the blog post about my argumentation.

If you have further comments or you have better idea for name than partialCurry please let me know, before closing the issue.

Once again, thank you for bringing this up.

Changes are implemented in Rambda version 0.7.0
Closing the issue