-
Notifications
You must be signed in to change notification settings - Fork 1
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
Swap functions to data last #27
Comments
Swapped math functions over in #23 |
If you have questions on the ethos behind this change, please reach out to @belsrc |
Is there an easy list of modules that need this treatment? |
I can get that list assembled, yes |
For this, as you mentioned, there is two possible future use approaches. Which might be nice/easier to do in tandem. Which probably want to have a larger discussion on them (another issue? rfc-ish thing? 🤷 ). That being "do we want to auto curry them or just curry them or do nothing." They all have benefits and drawbacks. |
When possible consistency is my highest priority; only challenge is when performance contradicts consistency. As I understand things (so far) we are rather concerned with performance - out of necessity - so have we run into any consistency challenges for performance reasons? If not, I tend to prefer to do less over doing more; i.e. don't curry till it is needed. |
Yea, thats part of the convo. Using Brandon's examples above:
|
There are two independent issues: Argument Ordering Ordering the arguments list to place the most variable values at the end to support curry-ing/partial application. Function Definition Writing a function such that it is curry-ied or not. Are we consistently creating library/reusable code in: a "curry"-ied style, an idiomatic style, or a mix of both? |
This could also be part of the discussion, I suppose. Most of the things that are currently in curry format ( Aside: @brandonjpierce , could also use a ticket for possibly cleaning up some calls. Things like the below don't need to be spelled out and can instead simply be point-free. export function toBoolean(val: unknown) {
return isTrue(val);
}
// ↓
export const toBoolean = isTrue; (This one is literally just an alias) |
After searching each file (I think) I haven't seen any functions that aren't "value last". |
Temporal stuff is the only thing that appears to not be current (didn't realize there was as many stubs in the repo). |
I think it would be better to create an issue for each instance rather than a broadly scoped issue like this or fix them as each comes into the repo. |
e.g. instead of
do
this way we can either auto curry this function or have it curried by default e.g.
and then in userland:
The text was updated successfully, but these errors were encountered: