Too Long; Didn't Read
Pattern matching is a founding block of FP software design, and an effective way to address the need of decoupling domain objects data and behaviors. FP is much more expressive than OOP with the Visitor pattern. The original purpose of the pattern was to iterate an operation over collections of heterogeneous objects, that doesn’t share the same interface. In this case, the compiler breaks every concrete visitor, until you implement the new method in each of them. In Kotlin, this is the same as FP pattern matching.