<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On May 27, 2016, at 4:52 PM, Matthew Johnson &lt;<a href="mailto:matthew@anandabits.com" class="">matthew@anandabits.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><blockquote type="cite" class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class=""><br class="Apple-interchange-newline">On May 27, 2016, at 7:20 AM, Thorsten Seitz 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=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">From the point of view of the type system `P &amp; Q` is an anonymous supertype of `P` and `Q`.<div class="">This would be just the same if the syntax was `Any&lt;P, Q&gt;`. I don’t see a semantic difference here.<div class=""><br class=""></div><div class="">Whether that is a "container“ or not seems to be an implementation detail to me but should have nothing to do with the type system.</div><div class="">In what way should it be "lossy“?</div></div></div></div></blockquote></div></blockquote><div><br class=""></div><div>what is by definition lossy, is the relationship between a type and an existential type that can represent it. Comes from the fact that there is no way to go back to the type we started from once all we hold is the existential (i.e. &nbsp;means it is a one —&gt; n mapping relationship, not a 1 —&gt; 1). Not the notation.</div><div>right?</div><br class=""><blockquote type="cite" class=""><div class=""><blockquote type="cite" class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><div class=""><br class=""></div><div class="">Am I missing something?</div></div></div></div></blockquote><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">I was a bit confused as well and had to read this several times. &nbsp;I think this is talking about a syntactic “container” - i.e. brackets of some kind (as opposed to a “free floating” syntax). &nbsp;I don’t think it is talking about a semantic difference of any kind. &nbsp;But maybe I am still confused an not understanding what was intended...</div></div></blockquote><div><br class=""></div><div><br class=""></div><div>given the semantic we wish to express (combination of conformance declarations), what possible ways do we have to express it. It come down to 2 families of syntax: the ‘container’ form, of which I gave a few examples, versus the non-container form (or free-floating conformance list) of which the straight list is the most obvious, but not the only one.&nbsp;</div><div><br class=""></div><div>Joe Groff was reminding us that the second group of syntax also exists.</div><div><br class=""></div><div>Compilers love Any&lt;P...Q&gt; , people’s brains love &nbsp;P &amp; Q</div><div><br class=""></div><blockquote type="cite" class=""><div class=""><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><blockquote type="cite" class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><div class=""><br class=""></div><div class="">-Thorsten</div><div class=""><br class=""></div><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">Am 27.05.2016 um 12:30 schrieb L. Mihalkovic &lt;<a href="mailto:laurent.mihalkovic@gmail.com" class="">laurent.mihalkovic@gmail.com</a>&gt;:</div><br class="Apple-interchange-newline"><div class=""><div dir="auto" class=""><div class="">It seem to me we are debating the<span class="Apple-converted-space">&nbsp;</span><i class="">how</i><span class="Apple-converted-space">&nbsp;</span>of a<span class="Apple-converted-space">&nbsp;</span><i class=""><b class="">what</b></i><span class="Apple-converted-space">&nbsp;</span>that has not been defined. The root question behind all these alternatives seems to be to decide if the existential-ness should be carried by a 'container' that is then refined internally, or derived from the presence of the<span class="Apple-converted-space">&nbsp;</span><i class="">free-floating</i><span class="Apple-converted-space">&nbsp;</span>refinements. This is the question that splits the possible syntaxes into these 2 groups:</div><div class=""><br class=""></div><div class="">Any&lt;&gt; Any[]</div><div class="">Type&lt;&gt; Type&lt;&gt;&nbsp;</div></div></div></blockquote></div></div></div></div></div></blockquote></div></blockquote><div><br class=""></div><div>this was meant to read&nbsp;</div><div>Type&lt;…&gt; &nbsp;Type { …. } &nbsp; Type[ … ]</div><br class=""><blockquote type="cite" class=""><div class=""><blockquote type="cite" class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><div class=""><div class=""><blockquote type="cite" class=""><div class=""><div dir="auto" class=""><div class="">Existential&lt;&gt;</div><div class=""><br class=""></div><div class="">and the (these are all straw man representations that should not limit the thinking)</div><div class=""><br class=""></div><div class="">P &amp; Q</div><div class="">@P and @Q</div><div class="">is P , Q</div><div class="">P &amp; Q typed</div><div class=""><br class=""></div><div class="">If the answer is to use a 'container' then the next question is to see its relationship to the other existing containers: is it the result of a transformation, is it a superset, or a super type; it is obviously lossy, but not entirely if the solution follows in some of Brent's past suggestion to make some existential types instantiate-able (which opens a very similar problem to what java faced for several years when trying to identify a universal collection literal syntax).</div><div class="">That will narrow down the field of possible matches... until one syntax emerges as conveying the meaning that is reflected by the answers to each question.</div><div class=""><br class="">On May 27, 2016, at 10:55 AM, Thorsten Seitz via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""><br class=""></div><blockquote type="cite" class=""><div class="">We could just write<div class=""><br class=""></div><div class="">let x: P &amp; Q</div><div class="">instead of</div><div class="">let x: Any&lt;P, Q&gt;</div><div class=""><br class=""></div><div class="">let x: Collection where .Element: P</div><div class="">instead of</div><div class="">let x: Any&lt;Collection where .Element: P&gt;</div><div class=""><br class=""></div><div class="">let x: P &amp; Q where P.T == Q.T</div><div class="">instead of</div><div class="">let x: Any&lt;P, Q where P.T == Q.T&gt;</div><div class=""><br class=""></div><div class="">let x: P &amp; Q &amp; R</div><div class="">instead of</div><div class="">let x: Any&lt;P, Q, R&gt;</div><div class=""><br class=""></div><div class="">let x: Collection</div><div class="">instead of</div><div class="">let x: Any&lt;Collection&gt;</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">This would avoid the confusion of Any&lt;T1, T2&gt; being something completely different than a generic type (i.e. order of T1, T2 does not matter whereas for generic types it is essential).</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">-Thorsten</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">Am 26.05.2016 um 20:11 schrieb Adrian Zubarev via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt;:</div><br class="Apple-interchange-newline"><div class=""><div class="bloop_markdown" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);"><p class="" style="margin: 15px 0px; -webkit-margin-before: 0px;">Something like<span class="Apple-converted-space">&nbsp;</span><code class="" style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal; -webkit-margin-before: 0px;">type&lt;…&gt;</code><span class="Apple-converted-space">&nbsp;</span>was considered at the very start of the whole discussion (<a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160502/016523.html" class="" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;">in this thread</a>), but it does not solve the meaning of an existential type and also might lead to even more confusion.<span class="Apple-converted-space">&nbsp;</span></p><p class="" style="margin: 15px 0px;">From my perspective I wouldn’t use parentheses here because it looks more like an init without any label<span class="Apple-converted-space">&nbsp;</span><code class="" style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal; -webkit-margin-before: 0px;">Type.init(…)</code><span class="Apple-converted-space">&nbsp;</span>or<span class="Apple-converted-space">&nbsp;</span><code class="" style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;">Type(…)</code>. I could live with<span class="Apple-converted-space">&nbsp;</span><code class="" style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;">Any[…]</code><span class="Apple-converted-space">&nbsp;</span>but this doesn’t look shiny and Swifty to me. Thats only my personal view. ;)</p><div class="" style="margin: 15px 0px;"><br class="webkit-block-placeholder"></div></div><div class="bloop_original_html" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);"><div id="bloop_customfont" class="" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;"><br class=""></div><br class=""><div id="bloop_sign_1464285716927451136" class="bloop_sign"><div class="" style="font-family: helvetica, arial; font-size: 13px;">--&nbsp;<br class="">Adrian Zubarev<br class="">Sent with Airmail</div></div><br class=""><p class="airmail_on" style="margin: 15px 0px;">Am 26. Mai 2016 bei 19:48:04, Vladimir.S via swift-evolution (<a href="mailto:swift-evolution@swift.org" class="" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;">swift-evolution@swift.org</a>) schrieb:</p><blockquote type="cite" class="clean_bq" style="margin: 15px 0px;"><span class="" style="margin-top: 0px; margin-bottom: 0px;"><div class=""><div class=""></div><div class="">Don't think {} is better here, as they also have "established meaning in<span class="Apple-converted-space">&nbsp;</span><br class="">Swift today".<br class=""><br class="">How about just Type(P1 &amp; P2 | P3) - as IMO we can think of such<span class="Apple-converted-space">&nbsp;</span><br class="">construction as "creation" of new type and `P1 &amp; P2 | P3` could be treated<span class="Apple-converted-space">&nbsp;</span><br class="">as parameters to initializer.<br class=""><br class="">func f(t: Type(P1 &amp; P2 | P3)) {..}<br class=""><br class=""><br class="">On 26.05.2016 20:32, L. Mihalkovic via swift-evolution wrote:<br class="">&gt; How about something like Type{P1 &amp; P2 | P3} the point being that "&lt;...&gt;" has an established meaning in Swift today which is not what is expressed in the "&lt;P1,P2,P3&gt;" contained inside Any&lt;P1, P2,P3&gt;.<br class="">&gt;<br class="">&gt;&gt; On May 26, 2016, at 7:11 PM, Dave Abrahams via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;">swift-evolution@swift.org</a>&gt; wrote:<br class="">&gt;&gt;<br class="">&gt;&gt;<br class="">&gt;&gt;&gt; on Thu May 26 2016, Adrian Zubarev &lt;<a href="mailto:swift-evolution@swift.org" class="" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;">swift-evolution@swift.org</a>&gt; wrote:<br class="">&gt;&gt;&gt;<br class="">&gt;&gt;&gt; There is great feedback going on here. I'd like to consider a few things here:<br class="">&gt;&gt;&gt;<br class="">&gt;&gt;&gt; * What if we name the whole thing `Existential&lt;&gt;` to sort out all<br class="">&gt;&gt;&gt; confusion?<br class="">&gt;&gt;<br class="">&gt;&gt; Some of us believe that “existential” is way too theoretical a word to<br class="">&gt;&gt; force into the official lexicon of Swift. I think “Any&lt;...&gt;” is much<br class="">&gt;&gt; more conceptually accessible.<br class="">&gt;&gt;<br class="">&gt;&gt;&gt;<br class="">&gt;&gt;&gt; This would allow `typealias Any = Existential&lt;&gt;`. * Should<br class="">&gt;&gt;&gt; `protocol A: Any&lt;class&gt;` replace `protocol A: class`? Or at least<br class="">&gt;&gt;&gt; deprecate it. * Do we need `typealias AnyClass = Any&lt;class&gt;` or do we<br class="">&gt;&gt;&gt; want to use any class requirement existential directly? If second, we<br class="">&gt;&gt;&gt; will need to allow direct existential usage on protocols (right now we<br class="">&gt;&gt;&gt; only can use typealiases as a worksround).<br class="">&gt;&gt;<br class="">&gt;&gt; --<br class="">&gt;&gt; Dave<br class="">&gt;&gt;<br class="">&gt;&gt; _______________________________________________<br class="">&gt;&gt; swift-evolution mailing list<br class="">&gt;&gt;<span class="Apple-converted-space">&nbsp;</span><a href="mailto:swift-evolution@swift.org" class="" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;">swift-evolution@swift.org</a><br class="">&gt;&gt;<span class="Apple-converted-space">&nbsp;</span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="">&gt; _______________________________________________<br class="">&gt; swift-evolution mailing list<br class="">&gt;<span class="Apple-converted-space">&nbsp;</span><a href="mailto:swift-evolution@swift.org" class="" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;">swift-evolution@swift.org</a><br class="">&gt;<span class="Apple-converted-space">&nbsp;</span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="">&gt;<br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></div></span></blockquote></div><div class="bloop_markdown" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);"><div class="" style="margin: 15px 0px; -webkit-margin-before: 0px;"><br class="webkit-block-placeholder"></div></div><span class="" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254); float: none; display: inline !important;">_______________________________________________</span><br class="" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);"><span class="" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254); float: none; display: inline !important;">swift-evolution mailing list</span><br class="" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);"><a href="mailto:swift-evolution@swift.org" class="" style="color: rgb(65, 131, 196); background-color: rgb(254, 254, 254); text-decoration: none; font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">swift-evolution@swift.org</a><br class="" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);"><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="" style="color: rgb(65, 131, 196); background-color: rgb(254, 254, 254); text-decoration: none; font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);"></div></blockquote></div><br class=""></div></div></blockquote><blockquote type="cite" class=""><div class=""><span class="">_______________________________________________</span><br class=""><span class="">swift-evolution mailing list</span><br class=""><span class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a></span><br class=""><span class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br class=""></div></blockquote></div></div></blockquote></div><br class=""></div></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=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></div></blockquote></div></blockquote></div><br class=""></body></html>