<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">I think I’d personally rather see this done with a generic error as well, like:</div><div class=""><br class=""></div><div class="">enum GenericResult&lt;T, E: Error&gt; {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>case success(T)</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>case failure(E)</div><div class="">}</div><div class=""><br class=""></div>And a typealias:<div class=""><br class=""></div><div class="">typealias Result&lt;T&gt; = GenericResult&lt;T, AnyError&gt;</div><div class=""><br class=""></div><div class="">This would require an “AnyError” type to type-erase a specific Error, but I’ve come across many situations where a strongly-typed error is&nbsp;<i class="">incredibly </i>useful, and I’d be reluctant to see that thrown away.</div><div class=""><br class=""></div><div class="">Dave<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Nov 2, 2017, at 12:08 PM, Jon Shier via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Swift-Evolution:<div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>I’ve written a first draft of a proposal to add Result&lt;T&gt; to the standard library by directly porting the Result&lt;T&gt; type used in Alamofire to the standard library. I’d be happy to implement it (type and tests for free!) if someone could point me to the right place to do so. I’m not including it directly in this email, since it includes the full implementation and is therefore quite long. (Discourse, please!)&nbsp;</div><div class=""><br class=""></div><div class=""><a href="https://github.com/jshier/swift-evolution/blob/master/proposals/0187-add-result-to-the-standard-library.md" class="">https://github.com/jshier/swift-evolution/blob/master/proposals/0187-add-result-to-the-standard-library.md</a></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Thanks,&nbsp;</div><div class=""><br class=""></div><div class="">Jon Shier</div><div class=""><br class=""></div><div class=""><br class=""></div></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></div></body></html>