If Result
is something that happens, it should be entirely distinct from Either
—they are semantically different concepts, and to relate them through a typealias and extensions would be a similar mistake to "inheritance as code reuse".
Result
is a concept that means "there is one of two mutually exclusive possibilities: a success case with a value, and an error case with error information." The names of the cases should correspond to those semantics.
Likewise, Either
is a concept that means "there is one of two values and there are no other semantics assumed about those values".
The names "left/right" don't make sense for Result
just as "success/failure" don't make sense for Either
, and neither type should allow its semantics to be described in terms of the wrong ones, which the proposed typealias would allow.
Furthermore, once we have variadic generics, Either
could reasonably be expressed as Either<First, Second, Others...>
to allow for more than two mutually exclusive possibilities (there's more to it than that, because we'd need "variadic cases", which... I don't even want to think about right now). But a Result
should never be more than a success case and an error case.