hborla
(Holly Borla)
7
I completely agree with this point, and I think the fact that reaching for existential types is far easier than generics, especially given Swift's emphasis on the power of value types and static type safety, is a really important problem to solve. Even without the sugar in this pitch, this is already a problem because programmers often abstract away concrete types with existential types without fully realizing that they're erasing important static type information, and better solution might be to use a type parameter.
I've posted a discussion topic about exactly this, and I'd love to hear your thoughts:
4 Likes