Andrew Kennedy
Check me out on the web at Andrew Kennedy (Microsoft Research Cambridge) or at my blog.
I'm a researcher at Microsoft Research in Cambridge, England.
Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
Andrew Kennedy: F# Units of Measure
Sep 24, 2009 at 1:39 AMThe units-of-measure information is not persisted, as it is "erased" from types before runtime. (It's a purely static feature.)
As for unit conversions, there are no plans for automatic conversions for this release of F#: you must define your own conversion functions.
Andrew Kennedy: F# Units of Measure
Sep 24, 2009 at 1:37 AMIt's fairly stable. Defining your own overloaded methods on unit-parameterized types is slightly easier, as type inference has been improved. For the product release, there will be a bunch of functions to "cast" into units (e.g. one with type float -> float<'u>) which are intended for interop with non-unit-aware code. (e.g. you might have a numeric library that you want to wrap with a units API.)
Andrew Kennedy: F# Units of Measure
Sep 23, 2009 at 7:39 AMAh - sorry about the unreadable code. I had been assuming that the screen would be captured in high-res. A lot of the examples that I used are also discussed on my blog. The Lunar Lander code was written by Phil Trelford but I'll put it back together and post it here shortly.
Andrew Kennedy: F# Units of Measure
Sep 23, 2009 at 7:07 AMYes, this is strictly a compile-time feature, so units errors get caught at development time, and there is no runtime performance hit.
It's for any types you like. Built-in types float, float32, decimal, and int can be parameterized on units, but you can build your own, e.g. vectors, complex numbers, matrices, or whatever. My blog (http://blogs.msdn.com/andrewkennedy) has more info.