1 comment

[ 4.1 ms ] story [ 17.1 ms ] thread
Units of measure has always struck me as a pet feature of F# that's only there because it happened to be what somebody's PhD dissertation was written on. Whether it is useful in practice is unclear.

I saw Don Syme give a presentation where he tried to add twice the variance to the mean of a variable. This is actually perfectly sensible to do -- it's some quantile point. But it gives a type error since variance has units squared in it. So he took the square root to solve the "problem." Obviously it was just a demo, but he claimed the the Microsoft Ad team had similar bugs confusing the variance and standard deviation. I can almost imagine some code maintenance guy adding units of measure and thinking there's a bug in some carefully constructed algorithm when in fact there is not.

All sorts of statistics have this issue.