2 ms·
That's not contradicting though. One can always choose not to use (native) sumtypes if they are interested in extreme performance or compatibility. But logica
by valenterry 5y ago
That's not contradicting though.
One can always choose not to use (native) sumtypes if they are interested in extreme performance or compatibility.
But logically speaking, it is _good_ that it's a restriction that a sumtype can't just turn into a multiple-fields type. Because while my software (as the consumer) might still be able to deserialize it, the assumption that only one field is set would be broken and my logic would now potentially broken. Much better if that happens at deserialization time then later one when I find out that my data is incorrect/corrupt.