This proposal changes the syntax for type parameters on functions, to eliminate the extra parens which are widely raised as a major problem with the draft proposal. It retains type parameters for types, and should otherwise be very similar to the draft proposal, just with a simpler syntax.
The key idea is: use generic type names just as we use concrete types now, instead of having separate type parameters. (Generic Types, GT)
GT puts all the type information in one place, instead of distributing it across two locations, greatly reducing cognitive load, and eliminates the extra parens in function calls which are confusing and a constant complaint about the draft proposal.
- Constraints are now
interface
types, so use these interface types directly as type names. - For fully generic, unconstrained types, use the keyword
type
. - Semantically, there are two categories of
interface
types: generic