Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unlock Existential Types for All Protocols #1176
Unlock Existential Types for All Protocols #1176
Changes from 11 commits
a4a5adf
a91f478
445c7f3
40b05a8
323a25a
a0057fe
b80a579
d27230f
1aa61d1
50a9916
ecbbf4c
97640d2
8f198a8
700ec25
3aa4b1f
86bb68c
d4b9f44
65daf57
5218234
2518bd3
1ca02f9
29c19fd
e8cc29d
c919e8c
8e53926
6eb13b0
412dc49
3b819cc
be0d18d
e151181
bace022
4b58873
0588dc1
24a3ec2
16e27a9
0e6f003
13bcd2c
93e80ca
c6d414e
7b3db88
ffcbed6
42e7918
3c93a1f
1e584d4
927fec1
6056aba
be883bd
016c458
0ebd95c
7ec8f02
d49cc87
0534ab0
df75054
61f6a8e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should avoid 'Foo' and 'Bar', because –– as Holly informed me during the writing of SE-293 –– it is actually an offensive term. Besides, I think we can find better examples with names and concepts that one is more likely to encounter in a real codebase.
I think a guide for intuitive code examples is the structured concurrency proposal's dinner preparation examples.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree we could (and I am going to) try harder on some examples, but I have mixed feelings on how reasonable that is for this particular one that shows a general approach to wrappers, or whether it is worth the time for some other rather subtle ones I would like to introduce in the "Detailed Design" section to cover the edge cases. These would most likely end up being an inseparable part of some large abstract interface if used in the wild.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that an overarching set of protocols, compositions, or use cases in general, used consistently across the proposal could help in both consistency and comprehensibility. So in the case of Detailed Design, we could provide descriptions and then some notable examples to help tie the thoroughly-discussed behavior together.
Of course, general examples are inherent in such an abstract feature –– which is not so much the case for the slightly more specific structured concurrency proposal. Structured concurrency is, of course, still an abstract concept; yet, the proposal authors did a great job of concentrating the concept into examples that showcase the its connection to a real-life task (cooking dinner).
Likewise, property wrappers, through review comments, were identified to belong to some categories, such as utility, proxy, domain-bound (or something to that effect); based on these categories, we settled on some wrappers that were used throughout the text, which I think helps with coherence.
For this proposal, I think the theme is dynamism. Existential types can take the place of generics I think we should focus on the "correct" use cases. The reason why I initially included
AnyView
is because every user of SwiftUI will have probably experienced the live previews as well. These is a great example of how an existential type acts as a bridge between the strictly-typed world of SwiftUI and the dynamic environment of Xcode previews.