-
Notifications
You must be signed in to change notification settings - Fork 351
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
Support for curry
#135
Comments
Sure! |
I was really happy to hear that es-toolkit decided to support the curry function!! I'm curious about your thoughts on implementing a strict rule for currying, where if a function takes multiple arguments, it transforms them into a composition of single-argument functions. This approach is a bit different from the lodash specification, which I will explain further. The curry function in lodash doesn't strictly enforce the rules of currying, and is more like providing partial application rather than true currying. I think one reason why developers often get confused between currying and partial application is because popular libraries like lodash use these terms incorrectly 😢 Therefore, I would like to suggest designing es-toolkit to follow the correct definition of currying strictly! However, this might make it harder to gain users since it wouldn't be a drop-in replacement for those who are used to lodash. |
@evan-moon THANK YOU FOR GOOD SUGGESTION! Indeed, the In fact, I am now implementing a 'flexible type of currying'. However, after reading your suggestions, I think it is important to respect the traditional method to enhance the depth of the library. How about this approach?
By implementing it this way, although users might be confused at first, I believe it is a valuable process to correct any misconceptions. |
@evan-moon Based on the suggestions provided and my reply, I have created draft PR #187! Please check it out and feel free to leave any comments & ideas! |
Thank you. Let's continue the discussion in that PR! 👍 |
Now curry and curryRight have been fully implemented! |
Thank you @D-Sketon 🙏 Then this issue can be closed now! |
Hello, @raon0211 !
As I mentioned at #133 , I would start work on
curry
!The text was updated successfully, but these errors were encountered: