[swift-evolution] Proposal: An Either Type in the STL

Developer devteam.codafi at gmail.com
Wed Dec 9 17:06:18 CST 2015

It’s high time the STL admitted some kind of disjoint union type, at the very least because it’s such a minor addition it seems a shame to leave it out.  Whatever feelings one may have about `throws`, the lack of standardizing on a datatype representing choice has caused the community to get creative and create many disjoint implementation of the same concept over and over and over again.  To that end, I propose the STL ship with an Either type; We at TypeLift have already got our own we’d like to model it on (https://github.com/typelift/Swiftx/blob/master/Swiftx/Either.swift#L16).

~Robert Widmann (CodaFi)

More information about the swift-evolution mailing list