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

Non-throwing dematerialize for result using NoError #260

Open
ileitch opened this issue Feb 25, 2018 · 1 comment
Open

Non-throwing dematerialize for result using NoError #260

ileitch opened this issue Feb 25, 2018 · 1 comment

Comments

@ileitch
Copy link

ileitch commented Feb 25, 2018

I'm pretty new to using Result, so perhaps this is possible by another concise means.

A variant of dematerialize that doesn't throw if the error type is NoError would be nice to have. I typically avoid try! throughout my code, and use SwiftLint to warn against its use. My options here are to use a magic comment to disable the SwiftLint rule, or do/catch - neither is particularly appealing. Thoughts?

@mdiep
Copy link
Contributor

mdiep commented Feb 26, 2018

The question is how that would affect type inference. I think it'd be fine to include if it doesn't introduce ambiguities. 👍

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