Related to this discussion is this great set of answers on the Software Engineering StackExchange, about representing Tagged Union types (AKA sum types) in OOP languages:
Related to this discussion is this great set of answers on the Software Engineering StackExchange, about representing Tagged Union types (AKA sum types) in OOP languages: