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

function: remove S.curry2, S.curry3, S.curry4, and S.curry5 #692

Merged
merged 1 commit into from
Aug 12, 2020

Conversation

davidchambers
Copy link
Member

Sanctuary's curry* functions were added in late 2016 (#289). In the intervening years, arrow function expressions have become widely supported (#687). Arrow function expressions make manual currying painless, so these functions no longer provide significant value.

The primary motive for removing these functions is to reduce the library's surface area. The other reason is that currying a “foreign” function is rarely the only change one should make. Other possible changes include:

  • changing argument order;
  • transforming inputs (e.g. converting Maybe String to Nullable String);
  • transforming outputs (e.g. converting Promise User to Future Error User); and
  • catching exceptions.

Sanctuary's curry* functions discourage consideration of such potential API improvements.

/cc @laduke

@davidchambers davidchambers requested a review from a team August 10, 2020 08:12
};
};
};
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these functions used within the codebase? Why are we keeping them around?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These functions are used to curry Z functions. curry4 is applied exactly once: curry4 (Z.lift3).

Copy link
Member

@Bradcomp Bradcomp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:bowtie:

@davidchambers davidchambers merged commit ff2c194 into master Aug 12, 2020
@davidchambers davidchambers deleted the davidchambers/no-curry branch August 12, 2020 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants