且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

F# 度量单位 - '提升'值以浮动<某物>

更新时间:2023-11-10 08:13:58

看起来度量单位暂时不能作为类型参数(不知道这是否会改变).所以写这个的最短方法是:

It looks like units of measure can't be type parameters for the moment (no idea if this will change). So the shortest way to write this is:

data |> List.map float |> List.map ((*) 1.0<m>)

编辑

现在也可以看到 FloatWithMeasure 这里

See also now FloatWithMeasure here

http://msdn.microsoft.com/en-us/library/ee806527(VS.100).aspx