<div dir="ltr"><div class="markdown-here-wrapper" style=""><p style="margin:0px 0px 1.2em!important">What makes me worry is if this syntax is really the best one possible:</p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code class="hljs language-swift" style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline;white-space:pre;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important;display:block;overflow-x:auto;padding:0.5em;color:rgb(51,51,51);background:rgb(248,248,248)"><span class="hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">typealias</span> <span class="hljs-type" style="color:rgb(68,85,136);font-weight:bold">ConstructibleFrom</span>&lt;<span class="hljs-type" style="color:rgb(68,85,136);font-weight:bold">V</span>&gt; = <span class="hljs-type" style="color:rgb(68,85,136);font-weight:bold">ConstructibleFromValue</span> <span class="hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">where</span> <span class="hljs-type" style="color:rgb(68,85,136);font-weight:bold">ValueType</span> == <span class="hljs-type" style="color:rgb(68,85,136);font-weight:bold">V</span>
</code></pre>
<p style="margin:0px 0px 1.2em!important">I find it strange that such exact line with <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">typealias</code> and <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">where</code> is required. I was hoping for an expression that lets us specialize a protocol and use it in-place, like so:</p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code class="hljs language-swift" style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline;white-space:pre;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important;display:block;overflow-x:auto;padding:0.5em;color:rgb(51,51,51);background:rgb(248,248,248)"><span class="hljs-class"><span class="hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">extension</span> <span class="hljs-title" style="color:rgb(153,0,0);font-weight:bold;color:rgb(68,85,136);font-weight:bold">MyType</span> : <span class="hljs-title" style="color:rgb(153,0,0);font-weight:bold;color:rgb(68,85,136);font-weight:bold">ConstructibleFromValue</span>&lt;<span class="hljs-title" style="color:rgb(153,0,0);font-weight:bold;color:rgb(68,85,136);font-weight:bold">ValueType</span> == <span class="hljs-title" style="color:rgb(153,0,0);font-weight:bold;color:rgb(68,85,136);font-weight:bold">V</span>&gt;
<span class="hljs-title" style="color:rgb(153,0,0);font-weight:bold;color:rgb(68,85,136);font-weight:bold">extension</span> <span class="hljs-title" style="color:rgb(153,0,0);font-weight:bold;color:rgb(68,85,136);font-weight:bold">MyType</span> : (<span class="hljs-title" style="color:rgb(153,0,0);font-weight:bold;color:rgb(68,85,136);font-weight:bold">ConstructibleFromValue</span> <span class="hljs-title" style="color:rgb(153,0,0);font-weight:bold;color:rgb(68,85,136);font-weight:bold">where</span> <span class="hljs-title" style="color:rgb(153,0,0);font-weight:bold;color:rgb(68,85,136);font-weight:bold">ValueType</span> == <span class="hljs-title" style="color:rgb(153,0,0);font-weight:bold;color:rgb(68,85,136);font-weight:bold">V</span>)</span>
</code></pre>
<p style="margin:0px 0px 1.2em!important">Also I thought that this topic does not really belong to generalized existentials:</p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code class="hljs language-swift" style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline;white-space:pre;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important;display:block;overflow-x:auto;padding:0.5em;color:rgb(51,51,51);background:rgb(248,248,248)"><span class="hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">var</span> x: <span class="hljs-type" style="color:rgb(68,85,136);font-weight:bold">ConstructibleFrom</span>&lt;<span class="hljs-type" style="color:rgb(68,85,136);font-weight:bold">Float</span>&gt;
</code></pre>
<p style="margin:0px 0px 1.2em!important">I mean, we specify all the types here, so the compiler should just specialize the protocol and use it as a normal existential. The only thing that does not allow us to do that now is syntax.<br>By comparison, the following <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">typealias</code> does require generalized existentials, because some <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">associatedtype</code>s, including <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">Iterator</code>, are not specified:</p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code class="hljs language-swift" style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline;white-space:pre;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important;display:block;overflow-x:auto;padding:0.5em;color:rgb(51,51,51);background:rgb(248,248,248)"><span class="hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">typealias</span> <span class="hljs-type" style="color:rgb(68,85,136);font-weight:bold">GenericCollection</span>&lt;<span class="hljs-type" style="color:rgb(68,85,136);font-weight:bold">E</span>&gt; = <span class="hljs-type" style="color:rgb(68,85,136);font-weight:bold">Collection</span> <span class="hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">where</span> <span class="hljs-type" style="color:rgb(68,85,136);font-weight:bold">Iterator</span>.<span class="hljs-type" style="color:rgb(68,85,136);font-weight:bold">Index</span> == <span class="hljs-type" style="color:rgb(68,85,136);font-weight:bold">Int</span>, <span class="hljs-type" style="color:rgb(68,85,136);font-weight:bold">Element</span> == <span class="hljs-type" style="color:rgb(68,85,136);font-weight:bold">E</span>
</code></pre>
<p style="margin:0px 0px 1.2em!important">It also shows that future generalized-existentials syntax will likely be exactly the same as the one we choose now for protocol specialization.<br>So we still should think twice before proceeding. We can implement this proposal now, but do we want to?</p>
<div title="MDH:V2hhdCBtYWtlcyBtZSB3b3JyeSBpcyBpZiB0aGlzIHN5bnRheCBpcyByZWFsbHkgdGhlIGJlc3Qg
b25lIHBvc3NpYmxlOjxkaXY+PGJyPjwvZGl2PjxkaXY+YGBgc3dpZnQ8L2Rpdj48ZGl2PnR5cGVh
bGlhcyBDb25zdHJ1Y3RpYmxlRnJvbSZsdDtWJmd0OyA9IENvbnN0cnVjdGlibGVGcm9tVmFsdWUg
d2hlcmUgVmFsdWVUeXBlID09IFY8L2Rpdj48ZGl2PmBgYDwvZGl2PjxkaXY+PGJyPjwvZGl2Pjxk
aXY+SSBmaW5kIGl0IHN0cmFuZ2UgdGhhdCBzdWNoIGV4YWN0IGxpbmUgd2l0aCBgdHlwZWFsaWFz
YCBhbmQgYHdoZXJlYCBpcyByZXF1aXJlZC4gSSB3YXMgaG9waW5nIGZvci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