Discriminated union types are a really fundamental building block of a type system. It's a sad state of matters that many mainstream languages don't have them.
ok, so what problems do they help me solve that I can't already solve? Is it just that we can make code more concise or am I missing a trick somewhere?
> Discriminated union types are a really fundamental building block of a type system. It's a sad state of matters that many mainstream languages don't have them.
"Non-discriminated" unions (i.e. untagged unions) are even less supported. TypeScript seems to be the only really popular language that has them.