I totally agree. Being able to work properly with existentials (and the other generics stuff from the generics manifesto) is more important for Swift than adding something like Ceylon's union and intersection types (even though I am a fan of them
Am 17. Mai 2016 um 09:09 schrieb Austin Zheng <email@example.com>:
This is the proposal I'd like to see go before review, and the one I think is closest in spirit to the generics roadmap.
Things like adding union types, and rewriting Swift's type system to look like Scala's, have very little to do with better representations of existentials, and belong in a follow-up proposal.
On May 16, 2016, at 11:55 PM, Brent Royal-Gordon via swift-evolution <firstname.lastname@example.org> wrote:
But don't you mean the union type of all possible Collection types when you write Any<Collection>?
No, I mean "an existential capable of holding any Collection".
If I write Any<Equatable, Collection>, I mean "an existential capable of holding any Equatable Collection".
If I write Any<UITableViewCell, CounterDisplaying>, I mean "an existential capable of holding any CounterDisplaying UITableViewCell".
If I write Any<Collection where .Element: Equatable>, I mean "an existential capable of holding any Collection with an Equatable Element".
If I write Any<class>, I mean "An existential capable of holding any class instance".
If I write Any, I mean "An existential capable of holding anything".
Union types have nothing to do with it.
swift-evolution mailing list