F#有一个度量单位的能力 (在这篇研究论文中有更多的细节)。 [<Measure>] type unit-name [ = measure ] 这允许单位被定义如: type [<Measure>] USD type [<Measure>] EUR 和代码写成: let dollars = 25.0<USD> let euros = 25.0<EUR> // Results in an error as the units differ if dollars > euros then printfn "Greater!" 它也处理转换(我猜测这意味着测量有一些定义的函数,让度量值相乘,分割和指数): // Mass, grams. [<Measure>] type g // Mass, kilograms. [<Measure>] type kg let […]