How do F# units of measure work?

风流意气都作罢 提交于 2019-11-28 20:38:22

According to a response 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.

Its not entirely clear whether it currently works with non-float types, but from the perspective of the type system it is theoretically possible.

The best (and I think official) place to find out about this is on Andrew Kennedy's blog.

Here are the (current) relevant posts.

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).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!