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

Use the new Result type instead of Choice for Errors #52

Closed
gusty opened this issue Dec 17, 2017 · 3 comments
Closed

Use the new Result type instead of Choice for Errors #52

gusty opened this issue Dec 17, 2017 · 3 comments

Comments

@gusty
Copy link
Member

gusty commented Dec 17, 2017

We'll need to adjust to what would be the new standard for signaling errors.

The question is what do we do with the existing type Choice<'OK,'Error>.

I think we should keep if as much as possible for backwards compatibility, but not just between this library version, there might be a lot of source code that uses the Choice convention and needs to keep working without doing a big refactoring.

@gusty gusty closed this as completed in d23d847 Dec 18, 2017
@wallymathieu
Copy link
Member

Indeed.

  • You could add a Compatibility namespace with Choice<'Ok,'Error>
  • You could add a Next namespace with Result<,>
  • Or go the YoLo path and have both in the same namespace (there might be some things that need to be fixed first though)

@gusty
Copy link
Member Author

gusty commented Dec 18, 2017

Or go the YoLo path and have both in the same namespace (there might be some things that need to be fixed first though)

I decided to use this approach when possible, ie for Functors, Applicatives and Monads. But there are other situations where only one should be the default to model computations.

See my comment on the commit for a summary of all these changes.

I'm happy to discuss further, or eventually re-open this issue and revert that commit.

@wallymathieu
Copy link
Member

No, I think selecting one approach is good.

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

No branches or pull requests

2 participants