Units of measure or single-case discriminated unions for compile-time dimensional safety?
Design goal I need a numeric API in F# that prevents adding incompatible quantities, such as metres and seconds, at compile time. The choice is between F# units of measure and single-case discriminated unions wrapping a float. Constraints Units of measure are erased in emitted IL, so reflection and C# callers see only the underlying primitive. Single-case un