<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div></div><div><br></div><div><br>Am 22.11.2017 um 06:25 schrieb Douglas Gregor via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>>:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Nov 21, 2017, at 9:21 PM, Chris Lattner <<a href="mailto:clattner@nondot.org" class="">clattner@nondot.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class="Apple-interchange-newline"><br class=""><blockquote type="cite" class=""><div class="">On Nov 21, 2017, at 7:19 PM, Douglas Gregor via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="auto" class=""><br class=""><br class=""><div class="">Sent from my iPhone</div><div class=""><br class="">On Nov 21, 2017, at 3:46 PM, Tony Allevato <<a href="mailto:tony.allevato@gmail.com" class="">tony.allevato@gmail.com</a>> wrote:<br class=""><br class=""></div><blockquote type="cite" class=""><div class="">Does that mean that once structural types can conform to protocols, would the core team want to remove Optional as a nominal type and just use “T?”?<span class="Apple-converted-space"> </span></div></blockquote><div class=""><br class=""></div><div class="">Yes; at least, it’s a direction we’ve discussed a number of times. </div><br class=""><blockquote type="cite" class=""><div class="">Or has that ship sailed because of source compatibility and you just don’t want to introduce any new nominals that shadow structurals?<br class=""></div></blockquote><div class=""><br class=""></div>typealias Optional<T> = T?<div class=""><br class=""></div><div class="">Should address source compatibility. </div></div></div></blockquote><br class=""></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Or alternatively, one could decide to make the generics system *only and forever* work on nominal types, and make the syntactic sugar just be sugar for named types like Swift.Tuple, Function, and Optional. Either design could work.</div></div></blockquote><br class=""></div><div>We don’t have a way to make it work for function types, though, because of parameter-passing conventions. Well, assuming we don’t invent something that allows:</div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>Function<Double, inout String></div><div><br class=""></div><div>to exist in the type system. Tuple labels have a similar problem.</div></div></blockquote><blockquote type="cite"><div><br></div></blockquote><br><div>Just throwing an idea out: what about</div><div><br></div><div> Function<Double, InoutParam<String>, Param<Int>></div><div><br></div><div>or</div><div><br></div><div> Function<Double, Param<String, .inout>, Param<String>></div><div><br></div><div>The latter assuming we had generics with value parameters (which is another common topic on this list) and defaults.</div><div>The first example might have the advantage of making use of inheritance between InoutParam and Param (which would require variance for type parameters, another common topic).</div><div><br></div><div>-Thorsten</div></body></html>