4 ms·
The system itself is interesting, though. In the simple case, a dimension associated with a value is a product of nonzero integer powers of units of different k
by evincarofautumn 14y ago
The system itself is interesting, though. In the simple case, a dimension associated with a value is a product of nonzero integer powers of units of different kinds—in the type theory sense—which may be the empty set for dimensionless values.
Different units of the same kind could define implicit conversions—for example, metres and yards are both of kind “length”. Each kind would be associated with an underlying type or interface—for example, length only makes sense for scalar values, such as integers and floats.
F# units of measure are an implementation of this special case. You could generalise it, though, to associate arbitrary static metadata with a type. That seems potentially useful, and like something someone should do.