Skip to content

Type Systems — Middle

Generics express relationships without losing concrete type information. Subtyping models substitutability; variance controls how generic containers relate. Inference solves constraints but can hide a surprising inferred type. Refinement and effect systems track more specific properties.

Test yourself

  1. Why is mutable collection covariance unsafe?
  2. What does parametricity guarantee?
  3. When should a type be explicit?

Continue to senior.md.