3 ms·
One unexpected aspect of unit-of-measurement types is that they don't generalize well at all to anything more complex than basic arithmetic. For example, it's v
by tsimionescu 5y ago
One unexpected aspect of unit-of-measurement types is that they don't generalize well at all to anything more complex than basic arithmetic. For example, it's very hard to create a type-safe library that allows you to compute the dot product of (1m 1Hz) and (1Hz 1m) and get 2m/s, but doesn't allow you to accidentally compute the dot product of (1m 1Hz) with itself.