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

remove flipped variants of binary operator functions #501

Merged
merged 1 commit into from
Mar 24, 2018

Conversation

davidchambers
Copy link
Member

Copy link
Member

@Avaq Avaq left a comment

Choose a reason for hiding this comment

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

It looks good to me. I like this. Based on the comment you linked it seems you will fix the signatures in a later commit, but I'll mention it in case you wanted to do it in this commit and forgot.

@gabejohnson
Copy link
Member

gabejohnson commented Mar 12, 2018

I'm slightly concerned that we're going to end up in the state we were in prior to #388. Perhaps if there's an entry in the wiki it won't be an problem.

@davidchambers
Copy link
Member Author

Based on the comment you linked it seems you will fix the signatures in a later commit, but I'll mention it in case you wanted to do it in this commit and forgot.

Thanks, Aldwin. It's best not to assume everything I do is intentional. :)

In this case, I think we should stick with the _ -> (_ -> _) types until we update sanctuary-def in an upcoming pull request (at which point all functions will adopt this stricter behaviour). S.lt (0, 1) is currently a type error, and it will be a type error once simple currying lands. I'd like to avoid a window in which it is valid (evaluating to false).

@davidchambers
Copy link
Member Author

I'm slightly concerned that we're going to end up in the state we were in prior to on #388.

Could you elaborate, Gabe? Your memory of the discussion preceding that pull request is likely better than mine. What are you concerned that users will incorrectly assume if we merge this pull request?

@gabejohnson
Copy link
Member

I'm referring to the issues/comments linked to in #388 (review). In the past, there has been a lot of confusion around argument order for binary operators.

Although their behavior is documented, I suspect the first time a new user reaches for S.lt they will assume the wrong argument order. Perhaps calling out the non-commutative "operators" individually or putting them in their own subsection would help.

@davidchambers
Copy link
Member Author

I suspect the first time a new user reaches for S.lt they will assume the wrong argument order.

Even though S.lt (x, y) will not be supported, Gabe? Feedback from Ramda and Sanctuary users gives me the impression is that the majority assume S.lt (0) to define the less than zero function.

@davidchambers davidchambers force-pushed the davidchambers/operators branch from 023fba5 to 38b81af Compare March 24, 2018 10:12
@davidchambers davidchambers merged commit 743c4a5 into master Mar 24, 2018
@davidchambers davidchambers deleted the davidchambers/operators branch March 24, 2018 10:24
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

Successfully merging this pull request may close these issues.

3 participants