FAQ: Why isn’t mutable a subtype of immutable, or vice versa?
Summary
The article explains why mutable and immutable data structures cannot be subtypes of one another under the Liskov Substitution Principle, using pairs as examples and discussing type classes, ad hoc polymorphism, and duck typing.