3 ms·
I don't really see it, unsigned says there's no sign. Given that and the number of bits it's exactly the expected behavior that it will not be able to produce a
by carlmr 5y ago
I don't really see it, unsigned says there's no sign. Given that and the number of bits it's exactly the expected behavior that it will not be able to produce a sensible result for subtracting something larger from something smaller.
Whether the operation then errors out or wraps doesn't change anything about unsigned being the right name for it, because it's something you wouldn't expect unsigned to do.
The intersection of your two NonEmptySet produces an empty set. If you write that result into a NonEmptySet it's the same, it doesn't make sense for you to expect a NonEmptySet as a result of that operation.