<div dir="ltr"><div class="markdown-here-wrapper" style=""><p style="margin:0px 0px 1.2em!important">2016-12-10 14:57 GMT+03:00 Adrian Zubarev &lt;<a href="mailto:adrian.zubarev@devandartist.com" target="_blank">adrian.zubarev@devandartist.com</a>&gt;:</p>
<p style="margin:0px 0px 1.2em!important"></p><div class="markdown-here-exclude"><p></p><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div class="m_-8066152455484115276bloop_markdown"><p>I’m fine with adding features step by step. ;)</p>

<p>There is no need for an explicit type alias in your</p>

<pre><code class="m_-8066152455484115276swift">extension MyStruct : Constructible&lt;String&gt; { … }
</code></pre>

<p>Because <code>Value</code> is already constrained by <code>String</code>.</p></div></div></blockquote><p></p></div><p style="margin:0px 0px 1.2em!important"></p>
<p style="margin:0px 0px 1.2em!important">That was my proposed syntax for inline conversion of associated-types protocols to generics. In this case, implicit or explicit, this typealias would appear in <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">MyStruct</code>.</p>
<p style="margin:0px 0px 1.2em!important"></p><div class="markdown-here-exclude"><p></p><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div class="m_-8066152455484115276bloop_markdown">

<p>In my <code>typealias</code> examples I mixed <strong>1.</strong> and <strong>4.</strong> together.</p>

<pre><code class="m_-8066152455484115276swift">protocol GenericFoo&lt;T&gt; : Foo where Value == T { /* nothing here */ }

typealias GenericFoo&lt;T&gt; = Foo where Value == T
</code></pre>

<p>I see that the latter cannot produce an actual new protocol, because it’s more like a macro and cannot be used multiple times for conformances.</p>

<pre><code class="m_-8066152455484115276swift">struct D : GenericFoo&lt;Int&gt;, GenericFoo&lt;String&gt; {}

// vs.
struct D : Foo where Value == Int, /* cannot add the second macro for String */ {}
</code></pre>

<p>And that is probably why we need real parametrized protocols.</p></div></div></blockquote><p></p></div><p style="margin:0px 0px 1.2em!important"></p>
<p style="margin:0px 0px 1.2em!important">That was not an unsolvable problem, but I guess, parametrized protocols is the first feature to consider. </p>
<p style="margin:0px 0px 1.2em!important"></p><div class="markdown-here-exclude"><p></p><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div class="m_-8066152455484115276bloop_markdown"><p> </p>

<p>Questions about <strong>1.</strong>:<br></p>

<ul>
<li>Does it affect ABI or is it needed to simplify the stdlib somehow?</li>
<li>Is it something for the current phase?</li></ul></div></div></blockquote><p></p></div><p style="margin:0px 0px 1.2em!important"></p>
<p style="margin:0px 0px 1.2em!important">I found that the only protocol family that looks like it could be replaced by a generic protocol, is <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">ExpressibleBy*</code> protocols.<br>But on a closer look, each of them has its own nuances, which prevents us from using a single <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">LiteralConvertible&lt;T&gt;</code> instead.</p>
<p style="margin:0px 0px 1.2em!important">So I guess, no existing ABI would need changes, and stdlib is not affected. So probably it’s not for current phase?<br>I really wish I’m wrong here.</p>
<div title="MDH:PGRpdiBjbGFzcz0iZ21haWxfZXh0cmEiPjxkaXYgY2xhc3M9ImdtYWlsX3F1b3RlIj4yMDE2LTEy
LTEwIDE0OjU3IEdNVCswMzowMCBBZHJpYW4gWnViYXJldiA8c3BhbiBkaXI9Imx0ciI+Jmx0Ozxh
IGhyZWY9Im1haWx0bzphZHJpYW4uenViYXJldkBkZXZhbmRhcnRpc3QuY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