Hacker News new | ask | show | jobs
by om2 588 days ago
What’s the difference between a union type and a disjoint union type? In that C# proposal I couldn’t tell which syntax was which branch of your dichotomy.
1 comments

disjoint union is sum type / enum / algebraic data type. Defined at the point of declaration. Each case is distinct (hence, disjoint)

union is what Typescript has. Defined at the point of use. Cases need not be distinct.