Replies: 2 comments 1 reply
-
Just a legacy bad decision, but it can be made less problematic if you stack them: SomeEitherProducingMethod()
.Match(r => DoRightStuff(r),
l => DoLeftStuff(l)); Or use argument names, which is good practice generally, as it's much more declarative: SomeEitherProducingMethod()
.Match(Left: l => DoLeftStuff(l), Right: r => DoRightStuff(r)); |
Beta Was this translation helpful? Give feedback.
1 reply
-
Interesting, I vaguely assumed you'd picked it up from Haskell or something. Doesn't really worry me, as I rarely think of them as left and right, I usually think of them as the happy path and sad path (picked those terms up from Scott Wlaschin), so it doesn't really matter which comes first. Thanks for clearing it up. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Been wondering this for ages, but never got around to ask.
If you look at a simple usage of
Either
, it could look like this...Stupid question, but why is the lambda that handles the case when
SomeEitherProducingMethod()
produces aLeft
on the right (ie second parameter toMatch
), and the lambda forRight
on the left (ie first parameter)?Beta Was this translation helpful? Give feedback.
All reactions