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

fromLeft and fromRight #683

Merged
merged 1 commit into from
Aug 1, 2020

Conversation

ryanbas21
Copy link

Forgot why I never opened this, but I can't see a reason to not push it forward. Let me know if there is anything you'd like me to add / change etc.

Summary of changes: Add functionality of fromLeft and fromRight

fromLeft :: a -> Either a b -> a
fromRight :: b -> Either a b -> b

@davidchambers
Copy link
Member

This pull request contains a subset of the changes proposed in #644. This pull request does not change the behaviour of fromEither, meaning that these changes could be included in the next minor release. This would result in two equivalent functions coexisting, which would be unusual given our avoidance of aliases. It seems like a reasonable course of action.

@davidchambers
Copy link
Member

@ryanbas21, as you may or may not be aware, #644 was open at the time you made your additions. That pull request has already been reviewed and discussed, and includes documentation. It makes sense to reuse @futpib's work rather than reproduce it, so I cherry-picked one of the commits and reverted the changes to fromEither included in that commit.

@futpib, I hope you are comfortable with me modifying one of your commits.

@ryanbas21, I hope you are comfortable with me commandeering your pull request.

Co-authored-by: David Chambers <[email protected]>
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

4 participants