[swift-evolution] [proposal] Either in the Swift Standard Library
Kevin Ballard
kevin at sb.org
Thu Jan 28 12:26:05 CST 2016
On Thu, Jan 28, 2016, at 06:15 AM, Matthew Johnson wrote:
>
> I think E would nearly always conform to ErrorType. Do you have any examples in mind of why you would want to use something for E that can’t conform to ErrorType (aside from the existential)?
Not particularly, it just seems like there's no real reason to put the constraint on the type when the type works just fine without it and we can put the constraint on an extension instead.
Also, if we do have the constraint on the type, then you can't have a Result<T,ErrorType> without solving the problem of making the existential conform to the protocol.
-Kevin Ballard
More information about the swift-evolution
mailing list