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

undefined is a valid Result #171

Open
marisbest2 opened this issue Oct 1, 2024 · 0 comments
Open

undefined is a valid Result #171

marisbest2 opened this issue Oct 1, 2024 · 0 comments

Comments

@marisbest2
Copy link

marisbest2 commented Oct 1, 2024

It feels very heavy handed to require that Result and Either not allow undefined as a valid value.

Given that javascript lacks a void value you can't return Ok() and so its reasonable that we'd use Ok(undefined).
Similarly, Either should be completely agnostic about the internals of the Left and Right types.

I understand why you went with Some(undefined) => None (though I actually don't love that either) but the other two seem unnecessary.

[Note that I think this is just a matter of removing NonUndefined from the types for Result and Either. I don't think it requires any logic changes, though I may be mistaken]

This change is making it very hard to adopt 0.7 and move away from 0.5.10

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

1 participant