<div style="white-space:pre-wrap">Does not this make associatedtype redundant additional complexity?</div><br><div class="gmail_quote"><div dir="ltr">On Tue, 6 Dec 2016 at 16:35 Martin Waitz <<a href="mailto:tali@admingilde.org">tali@admingilde.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Am 2016-12-06 15:01, schrieb Daniel Leping via swift-evolution:<br class="gmail_msg">
><br class="gmail_msg">
> ConstructibleFromValue<ValueType == V><br class="gmail_msg">
><br class="gmail_msg">
> Sounds way better to me than the second option considering we can't do<br class="gmail_msg">
> just<br class="gmail_msg">
><br class="gmail_msg">
> ConstructibleFromValue<V><br class="gmail_msg">
><br class="gmail_msg">
> Because of lack of order of associated types. So IMO either we<br class="gmail_msg">
> introduce order or we use == syntax.<br class="gmail_msg">
<br class="gmail_msg">
we should be careful not to mix up associated types with actual generic<br class="gmail_msg">
type parameters.<br class="gmail_msg">
When we introduce type parameters for protocols, they should be written<br class="gmail_msg">
within angle brackets.<br class="gmail_msg">
Requirements for associated types should just stay after `where`.<br class="gmail_msg">
<br class="gmail_msg">
>> What makes me worry is if this syntax is really the best one<br class="gmail_msg">
>> possible:<br class="gmail_msg">
>><br class="gmail_msg">
>> typealias ConstructibleFrom<V> = ConstructibleFromValue where<br class="gmail_msg">
>> ValueType == V<br class="gmail_msg">
>><br class="gmail_msg">
>> I find it strange that such exact line with typealias and where is<br class="gmail_msg">
>> required.<br class="gmail_msg">
<br class="gmail_msg">
Why?<br class="gmail_msg">
It introduces a new generic type which is equivalent to some protocol<br class="gmail_msg">
with additional requirements,<br class="gmail_msg">
where the requirement on the associated type is parameterized.<br class="gmail_msg">
<br class="gmail_msg">
Of course we should also allow to directly write parameterized<br class="gmail_msg">
protocols:<br class="gmail_msg">
<br class="gmail_msg">
protocol ConstructibleFrom<V> {<br class="gmail_msg">
[...]<br class="gmail_msg">
}<br class="gmail_msg">
<br class="gmail_msg">
which can then be used with the type parameter:<br class="gmail_msg">
<br class="gmail_msg">
struct Stuff: ConstructibleFrom<Things> {}<br class="gmail_msg">
<br class="gmail_msg">
When we consider type parameters to be part of the protocol name,<br class="gmail_msg">
then we can also support conformance to multple protocols which only<br class="gmail_msg">
differ in the type parameter.<br class="gmail_msg">
<br class="gmail_msg">
--<br class="gmail_msg">
Martin<br class="gmail_msg">
</blockquote></div>