3 ms·
You're right that you can't destructure until you've established which side of the union you got, does the tag help with that? I like a Result type over an Eit
by tym0 6y ago
You're right that you can't destructure until you've established which side of the union you got, does the tag help with that?
I like a Result type over an Either because it feels semantically more meaningful. I work with people with a wide range of background and a Result type is self explanatory, they can just read the code by themselves without knowing and understanding the convention of which side of the branch the error goes, etc...
- valand 6y agoI agree with you on the Result type being semantically more meaningful and I agree there are a lot of conventions to be remembered coming from functional programming that gets meta. Thanks for the insight