Thanks for putting this together! I’ll start by replying at a high level and then get into some specifics.
At a proposal level, I don’t think this proposal would be well served by trying integrate every bit of feedback given in this thread and elsewhere. To me, that just creates more friction in the community by baking in features people might disagree with, as well as making the implementation that much more complex. My purpose with this proposal is to create the most generally usable Result I can that fits in the Swift standard library. The type, plus a base level of convenience API that is similar to other types in the stdlib is what I’m aiming for here. To me, that means super common Result functionality, like map or initializing from a throwing closure. Not the full breadth of functional API possible for a Result type, nor every possible convenience feature, as most of those can be added later, if popular enough. Ultimately this proposal aims to bring the benefits of Result to everyone while at the same time allowing everyone who’s written their own version to standardize on Swift’s instead.
Moving on to more specific issues; I couldn't disagree more with your typealias. Not only is it unnecessary (you haven't justified it beyond Result<Value> being the spelling you want) but incredibly backwards. Even if I was a fan of such built in alias (I'm not), it should flow from most general to less, not the other way around. Result<Value, Error> to ErrorResult<Value>. But I think offering an alias along with the introduction of the type itself would just cause confusion.
I see little value in init(_ value:) or init(error:), as they're barely any more convenient than just spelling out the case names. init(_ value:nilError:) may be useful, but I'm not sure about making it part of the initial implementation. I think an initializer like init(_ value: _ error:) would be more useful to map from Apple's API's which return optional success and failure values. I'll think about that one further.
optionalValue and optionalError go against the naming guidelines, plain and simple.
I'll be revisiting the various maps with throwing closures, but something like bimap is unprecedented in the standard library, AFAIK, and I don't really want to discuss its value at the moment.
hasValue and hasError seem very awkwardly named to me, and are largely served by having isSuccess. The ability to check for a certain type of error is interesting, but like most of the functionality you've outlined, I think is best left for later, depending on use.
I like onSuccess and onError, and I added them to the Alamofire Result implementation myself (along with ifSuccess and ifFailure), but I think such API should be common across all relevant types in Swift, particularly Optional. I'd like to see Optional add withValue or something, in addition to map, and if that happens, I'd like Result's to line up so users aren't surprised when they move between types.
As for the rest of the functional API, I think it's best to wait for Result to be accepted and then used, and then add popular functionality. Not everyone who uses Result will need to use it with those APIs, so I think it's best to see how it's being used before bundling in more functionality.
So thanks for the work, but I'm pretty happy with the level of functionality the proposal's at right now. If this gets into review, I'll be happy to add or remove whatever functionality the core team feels is necessary for Result to fit into the standard library, but for now I'm going to keep things simple.