|
|
|
|
|
by nyssos
768 days ago
|
|
Sum types are disjoint unions. This `T` has three cases L = { tag: "a", payload: string } | { tag: "b", payload: number }
R = { tag: "b", payload: number } | { tag: "c", payload: boolean }
T = L | R
whereas a proper sum type `L + R` would have four. |
|
For all purposes and intents, the "b" type in L and R should be treated the same, no? What do you gain by not doing that??