Tag
This article explains why mutable data types cannot be subtypes of immutable types in programming languages, using the Liskov substitution principle and pairs as an example to highlight type safety and immutability contracts.
The article explores the Liskov Substitution Principle beyond its common interpretation, emphasizing its formal basis in subtyping with preconditions, postconditions, invariants, and history properties, and citing original research papers.