<div dir="ltr">I think the rationale thread for the original version of this proposal pretty much shut down the possibility of disjunctive type constraints. In fact, the primary argument against '&' was that it would encourage conversations about '|'.<div><br></div><div>It's also been added to the commonly rejected proposals list: <a href="https://github.com/apple/swift-evolution/blob/master/commonly_proposed.md">https://github.com/apple/swift-evolution/blob/master/commonly_proposed.md</a></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 27, 2016 at 9:48 AM, Joe Groff via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> On Jun 25, 2016, at 12:00 AM, L. Mihalkovic <<a href="mailto:laurent.mihalkovic@gmail.com">laurent.mihalkovic@gmail.com</a>> wrote:<br>
><br>
> Inline<br>
> Regards<br>
> (From mobile)<br>
><br>
>> On Jun 25, 2016, at 1:00 AM, Joe Groff via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br>
>><br>
>><br>
>>> On Jun 23, 2016, at 8:55 PM, Jordan Rose via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br>
>>><br>
>>> [Proposal: <a href="https://github.com/apple/swift-evolution/blob/master/proposals/0095-any-as-existential.md" rel="noreferrer" target="_blank">https://github.com/apple/swift-evolution/blob/master/proposals/0095-any-as-existential.md</a> ]<br>
>>><br>
>>> I’ve gone on record before as against this syntax, although when I set out earlier today to record my usual rebuttal I found that it really was mostly a matter of taste. Yes, this looks weird to me:<br>
>>><br>
>>> let callback: (Data) -> NSCoding & NSCopying<br>
>>><br>
>>> but I’m sure the infix ‘->’ for functions looked weird to everyone the first time they saw it as well, and it really is pretty clear in argument position.<br>
>><br>
>> We could conceivably bracket the 'where' constraints somewhere. It's nice not to have to punish the common case syntax. In my personal ideal vision of the world, I'd like to see us support opening existentials via path-dependent types (e.g., let a: Collection; let element: a.Element). If we support them in decl-level 'where' clauses, we provide a nice, clean syntax for complex generic relationships that doesn't require angle brackets or per-existential where clauses at all, something like:<br>
>><br>
>> func intersect(a: Collection, b: Collection) -> Collection<br>
>> where a.Element == b.Element, b.Element == return.Element {<br>
>> }<br>
>><br>
>> which doesn't completely define away the need for 'where' as part of existential types, but would shrink it quite a bit.<br>
><br>
> For some reason it had not clicked until your 'path dependent type' reference how reminicent of (U+00B7) this is. I watched nada's 2014 presentation again... but then it means intersection types would add a lot... you guys seem ok to add P&Q now, so why not take that opportunity to allow P|Q at the same time. Does it also mean that you might consider at some point expanding 'assoctype U' into: T where <:U , :>U opening the door to lower/higher type bounds?<br>
<br>
</span>Let's not rathole on the P|Q thing. Disjunctions are difficult to make much sense of in a parametric type system like ours; there are plenty of other threads on this mailing list discussing it.<br>
<br>
-Joe<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</div></div></blockquote></div><br></div>