typerystem
A typerystem is a formal framework in programming languages for classifying values and expressions by types and guiding how they can be combined. It helps detect errors such as applying a function to an incompatible argument and can support optimizations and documentation through typed contracts.
A typerystem comprises a set of types and type constructors, rules for building complex types, and a
Typing disciplines vary: static vs dynamic; strong vs weak; nominal vs structural. Static systems catch errors
Common features include generics (parametric polymorphism), subtyping, and advanced forms such as union or intersection types,
Examples range from Java, C#, and TypeScript (static families) to Python with optional typing and to functional
Origins lie in the simply typed lambda calculus and Hindley-Milner polymorphism; modern type systems extend these