DigiNews

Tech Watch by Johan Denoyer

← Back to articles

FAQ: Why isn’t mutable a subtype of immutable, or vice versa?

Quality: 8/10 Relevance: 8/10

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.

🚀 Service construit par Johan Denoyer