Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Curry style #5

Closed
danrspencer opened this issue Jun 5, 2017 · 5 comments
Closed

Curry style #5

danrspencer opened this issue Jun 5, 2017 · 5 comments

Comments

@danrspencer
Copy link

danrspencer commented Jun 5, 2017

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

?

@selfrefactor
Copy link
Owner

selfrefactor commented Jun 8, 2017

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.

@selfrefactor
Copy link
Owner

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?

@danrspencer
Copy link
Author

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?

@selfrefactor
Copy link
Owner

selfrefactor commented Jun 9, 2017

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.

@selfrefactor
Copy link
Owner

Changes are implemented in Rambda version 0.7.0
Closing the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants