3 ms·
You can't have the zero value of a union be the zero value of the first written term or (a | b) becomes different from (b | a).
by aatd86 2y ago
You can't have the zero value of a union be the zero value of the first written term or
(a | b) becomes different from (b | a).
- noelwelsh 2y agoCommutativity doesn't apply to sum types, though it does apply to union types. Here I'm using the type theory terms, not the terms used by OP. So this isn't really an issue. Zero values don't make any sense anyway. As the original comment said "You might think this is a pretty dumb design decision that can lead to programmer error, but it meshes perfectly with the other mistakes in the language."