Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Andrew Kennedy

Andrew Kennedy akenn

Niner since 2009

I'm a researcher at Microsoft Research in Cambridge, England.
  • Andrew Kennedy: F# Units of Measure

    The 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

    It'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

    Ah - 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

    Yes, 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.