4 ms·
Sum types don't fit well with zero values. What is the zero value of an `(int|string)` union type ?
by sacado2 11y ago
Sum types don't fit well with zero values. What is the zero value of an `(int|string)` union type ?
- aninhumer 11y agoWell I don't think zero values are a very good idea to start with (if you want a default value, make it explicit), but if one insists on having them, they can just use the first case. So for your example it would be int 0.