Sealed classes are like meta-enums. An enum is a single type with a finite set of values. A sealed class is a type
hierarchy with a finite set of subtypes, each of which can have arbitrary many values. It is useful when you want to represent values of different types (for instance with different properties) but you also want to be able to exhaustively check these types in a
when
(which you woudn't be able to do with regular inheritance hierarchy)