[Revised] SE-0235: Add Result to the Standard Library

Strong +1 from me, and I agree with most of the changes, but also share the view that success/failure better describe the cases.

I can see the thinking behind having the case named value and error for consistency, but in my view the case and the type are describing different things:

Success is the status of the Result. The Result was success, and the fruit of that success was a value. The value is not the status, especially (as others have pointed out) since that value may be of type Void in situations where we only care about the status.

I don’t feel very strongly about this, and I’d much rather have Result with these names than not at all, but since naming cases to match the values is not an established convention in Swift already (e.g some(Wrapped) for Optional), I see no reason to deviate from the de-facto standard of success/failure.

22 Likes