3 ms·
The article seems to be mixing up type synonyms with type variables. Type variables have an actual well defined meaning. They act like variables that can be ins
by sfvisser 5y ago
The article seems to be mixing up type synonyms with type variables. Type variables have an actual well defined meaning. They act like variables that can be instantiated during inference/checking, analogue to how variables in the expression language get instantiated at runtime.
- rendall 5y ago> Type variables have an actual well defined meaning. In TypeScript or JavaScript? Can you say more?
- sfvisser 5y agoType variables are sometimes called generics and a part of the type language, so JavaScript doesn’t have them. Typescript, but also Rust, Haskell, Java, the ML-family have them. Type variables abstract over types and are analogous to function parameters at the values level. Think the ‘T’ in ‘List<T>’.
- rendall 5y agoThanks