2 ms·
Not really the same thing. The point is that validation alone is then lost as information later on. E.g. validating an int to be positive has limited benefits
by epolanski 2y ago
Not really the same thing.
The point is that validation alone is then lost as information later on.
E.g. validating an int to be positive has limited benefits if you don't parse it to be a positive int, because there's no such information at the type level later on, same could apply to a non empty array/list where following consumers would then need to check again if the list is really non empty.
This kind of information cannot always be encoded in objects or constructors.