Adding Either type to the Standard Library

I’m assuming you are talking about Union Tuples - not regular ones.

I don’t think it would. Up-thread there has been a lot of discussion about an OneOf type. Or how multiple such types (OneOf2, OneOf3...) could be added. I think the “multiple such types” post will give you an ideas of how we could migrate to a variadic OneOf. To sum it up, we would just deprecate Either and encourage the use of OneOf in its place. So if you’re concerned that Either will limit our future options, you shouldn’t.

Compiler magic to convert the expression:

typealias MyOneOf 
    = (foo: Foo | bar: Bar)

Could be converted to:

typealias MyOneOf(first|second|) 
    = OneOf<Foo, Bar>

That would be similar to another post that proposes baking the closure labels into the identifier. That though is a future proposal altogether, that requires to be built one top of OneOf. There has also been talk of a “native” Union Tuple type, that will have custom compiler support. Nonetheless, that type is not acceptable to the Core Team, as they are hardly keen on the idea of an OneOf a type that is currently unimplementable as it requires advanced variadic genetics - correct me if I’ve misinterpreted. All in all, I would appreciate ideas that are applicable to the proposal of adding an Either like type. Lastly, I’d like to say that I don’t see a Union Type built into the compiler as a reasonable option, because it would further complicate the compiler and because there has been talk of even replacing Tuples with a normal type.