SE-0235 - Add Result to the Standard Library

It allows that, but it would strongly discourage it in documentation, naming, etc. And if you saw that type you would instantly understand that something strange was going on, and perhaps MyError really was the success type somehow. Analogously, I don't think these two types are interchangeable

struct Point { var x, y: Double }
struct Dimensions { var width, height: Double }

and that you should only define one or the other, or combine them both into

struct DoublePair { var first, second: Double }

or even

struct Pair<T> { var first, second: T }
3 Likes