Adding Either type to the Standard Library

First of all, I’d like to address the part regarding focusing our efforts on variadic generics. I think everyone wants variadic generics, especially me. I’ve been working with function builders and without variadic generics some parts are really mess. But I hate to see, that discussion about variadic generics has been going on for years, yet still to this date there’s no such feature. Not to mention that an OneOf type would require probably an advanced Variadics feature, as repetition of an element - OneOf<Foo, Foo> - should not be allowed.

What has been presented in this thread are real problems - in my previous post I think I mentioned some. So, seeing function builders, the standard library and other projects result to custom types and more repetitive code - that in most cases are just boilerplate - I though that a sensible direction would be a standardized Either type. And many counter-proposals I don’t see a viable alternative. What Either offers is a great set of features - custom conformance, a standardized type etc.

Yes I still think Either isn’t ideal overall, but it’s best for now, where there is a need for such a type. Furthermore, if a new Variadic type comes along and renders the use of a two-case Either type useless, it could slowly be deprecated and removed.

To sum up, there are problems that require an Either like type, whether it’ll be named Either or OneOf doesn’t matter, what matters is that those problems be solved. Once an OneOf comes along, which will most likely take a while, Either will have already helped in a lot of situations and eliminated a lot of boilerplate.