<p>Has anyone had a chance to dig into how <a href="http://blogs.msdn.com/andrewkennedy/archive/2008/08/20/units-of-measure-in-f-part-one-introducing-units.aspx" rel="noreferrer">F# Units of Measure</a> work?  Is it just type-based chicanery, or are there CLR types hiding underneath that could (potentially) be used from other .net languages? Will it work for any numerical unit, or is it limited to floating point values (which is what all the examples use)?</p>

[{'answer_id': 40891, 'author': 'megabytephreak', 'author_id': 4108, 'author_profile': 'https://Stackoverflow.com/users/4108', 'pm_score': 5, 'selected': True, 'text': '<p>According to a <a href="http://blogs.msdn.com/andrewkennedy/archive/2008/08/22/units-of-measure-in-f-part-two-unit-conversions.aspx#8920660" rel="noreferrer">response</a> on the next related blog post, they are a purely static mechanism in the F# compiler. So there is no CLR representation of the units data.</p>\n\n<p>Its not entirely clear whether it currently works with non-float types, but from the perspective of the type system it is theoretically possible. </p>\n'}, {'answer_id': 81467, 'author': 'Benjol', 'author_id': 11410, 'author_profile': 'https://Stackoverflow.com/users/11410', 'pm_score': 4, 'selected': False, 'text': '<p>The best (and I think official) place to find out about this is on Andrew Kennedy\'s blog.</p>\n<p>Here are the (current) relevant posts.</p>\n<ul>\n<li><a href="https://learn.microsoft.com/en-us/archive/blogs/andrewkennedy/units-of-measure-in-f-part-one-introducing-units" rel="nofollow noreferrer">Units of Measure in F#: Part One, Introducing Units</a></li>\n<li><a href="http://web.archive.org/web/20100118052651/http://blogs.msdn.com/andrewkennedy/archive/2008/09/02/units-of-measure-in-f-part-two-unit-conversions.aspx" rel="nofollow noreferrer">Units of Measure in F#: Part Two, Unit Conversions</a></li>\n<li><a href="https://learn.microsoft.com/en-us/archive/blogs/andrewkennedy/units-of-measure-in-f-part-three-generic-units" rel="nofollow noreferrer">Units of Measure in F#: Part Three, Generic Units</a></li>\n<li><a href="https://learn.microsoft.com/en-us/archive/blogs/andrewkennedy/units-of-measure-in-f-part-four-parameterized-types" rel="nofollow noreferrer">Units of Measure in F#: Part Four, Parameterized Types</a></li>\n</ul>\n<p>As I said in the post that your answerer referred to, this is most definitely something that you CAN\'T do in C# (though I wish you could).</p>\n'}]
['https://Stackoverflow.com/questions/40845', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2495/']