Interestingly, from your description of a binary tree, it could also be defined in Haskell as:
Yawar λmin

Yes, that’s true, sub-classing is a fine way to make sum types in an OO language. Where things get awkward, however, is when you try to traverse a structure like that. It seems you either have to check types and cast, or else use something like the visitor pattern.

So I think the difference is that ML languages make it really easy to define sum types, and then really easy to work with them thanks to pattern matching.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.