-
Notifications
You must be signed in to change notification settings - Fork 57
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
Idea: opt-in auto-curry? #90
Comments
1-liners-plus can be auto-generated like our index. It can also just be a folder in this repo:
|
That's what I proposed in #17. I would prefer a separate repo to keep the repo clean. 👍 for using chickencurry 😄 but maybe it is cleaner if we use 1-liners/curry (more predictable) Names:
|
Yeah, but I think we really want a haskell-like f(1, 2, 3, 4) ===
f(1)(2, 3, 4) ===
f(1, 2)(3, 4) ===
f(1, 2, 3)(4) ===
f(1, 2)(3)(4) ===
f(1)(2, 3)(4) ===
f(1)(2)(3, 4) ===
f(1)(2)(3)(4); With f(1)(2, 3, 4) ===
f(1, 2)(3, 4) ===
f(1, 2, 3)(4); |
Sorry, I didn’t quite get it back then :) That was absolutely a good idea. |
Np
Yop, you are right that could be done with |
In the best case: // ▤ chickencurry/_.js
export const _ = Symbol(); import _ from 'chickencurry/_';
f(1, 2, 3, 4) ===
f(_, _, 3, _)(1, 2, 4); |
👍 for changing the placeholder to a Symbol. but I guess you meant? f(1, 2, 3, 4) ===
chickencurry(f)(_, _, 3, _)(1, 2, 4); |
Jain :) I meant import f from '1-liners-curried/f'; |
I will get started on this on Saturday. |
Or if you guys are first you can give it a shot |
I'm working on separating the |
👋 chiming in, would love to have simplistic currying like Sanctuary does, think that aligns well with the intention of this project. So there is only one way to call a function which offers multiple benefits. What about adding a second |
I’ve never really had the time to get my hands on it, but AFAIK pure functional languages come with currying out of the box.
I like it how 1-liners stays lean – without dependencies – without inter-module imports – without auto-currying and other fancy. But I often find myself currying half of the 1-liners functions I import.
How about creating another repo with all functions auto-curried by default? With chickencurry or something.
The text was updated successfully, but these errors were encountered: