[swift-evolution] Enhanced existential types proposal discussion

David Waite david at alkaline-solutions.com
Mon May 23 09:02:25 CDT 2016


Excellent! I’m glad to see someone pick this up (and interest this time! I was disheartened earlier by lack of discussion when I proposed this)

One initial bit of feedback -  I believe if you have existential types, I believe you can define Sequence Element directly, rather than with a type alias. e.g.

protocol Sequence {
  associatedtype Element
  associatedtype Iterator: any<IteratorProtocol where IteratorProtocol.Element==Element>
  associatedtype SubSequence: any<Sequence where Sequence.Element == Element>
  …
}


> On May 22, 2016, at 6:18 PM, Austin Zheng via swift-evolution <swift-evolution at swift.org> wrote:
> 
> 
> Speaking of which, for those who care I rewrote the draft proposal to attempt a much more rigorous treatment of the semantics of the generalized existential, including a discussion about existential type equivalence and subtyping. It would be nice to see people poke holes in my logic so I can patch them up. https://github.com/austinzheng/swift-evolution/blob/az-existentials/proposals/XXXX-enhanced-existentials.md <https://github.com/austinzheng/swift-evolution/blob/az-existentials/proposals/XXXX-enhanced-existentials.md>
> 
> Austin

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160523/b82c6aa9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 496 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160523/b82c6aa9/attachment.sig>


More information about the swift-evolution mailing list