SE-0235 - Add Result to the Standard Library

I mentioned in the "unconstrained-boogaloo" (but wasn't directly responded to on), that I think this:

let one = Result { try String(contentsOfFile: oneFile) }

should instead be: (with compiler support)

let one = catch String(contentsOfFile: oneFile)

catch is already a keyword, in the error handling domain, and this prevents needing to write Result, try, or use a closure.

6 Likes