-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Pipeline Operator but for Generic Types #35712
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
Comments
Near-duplicate of #34165 |
Similarly to #34165 I find the readability claim debatable. Also what happens with generics with multiple type parameters ? would you use |
Promise of String |
Parentheses are too close to angle brackets for my taste; no human being uses parentheses or angle brackets to communicate. Instead of punctuation we should use a keyword to signify where a generic parameter list ends. Since reusing existing keywords is preferable to coining new ones (and helps the environment), a good one to use for this would be Pick<Map<string, Promise<number>>, "get"> into the human-friendly Pick of Map of string with Promise of number finally finally "get" finally |
@jcalz 😬 We're extremely conservative around adding syntax to the type space; new syntax needs to have very concrete upsides |
Search Terms
pipeline operator
generic types
Suggestion
A pipeline operator but for generic types
Use Cases
This would be less ugly and more readable
Examples
The following
would become
On an interface
Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: