Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do F# units of measure work?

Has anyone had a chance to dig into how F# Units of Measure 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)?

like image 306
Emperor XLII Avatar asked Sep 02 '08 22:09

Emperor XLII


People also ask

What does f mean in math?

more ... A special relationship where each input has a single output. It is often written as "f(x)" where x is the input value.

How do you calculate the f?

Find the F Statistic (the critical value for this test). The F statistic formula is: F Statistic = variance of the group means / mean of the within group variances. You can find the F Statistic in the F-Table.

What does f say about f?

What Does f ' Say About f ? The first derivative of a function is an expression which tells us the slope of a tangent line to the curve at any instant. Because of this definition, the first derivative of a function tells us much about the function. If is positive, then must be increasing.


1 Answers

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

Here are the (current) relevant posts.

  • Units of Measure in F#: Part One, Introducing Units
  • Units of Measure in F#: Part Two, Unit Conversions
  • Units of Measure in F#: Part Three, Generic Units
  • Units of Measure in F#: Part Four, Parameterized Types

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

like image 110
Benjol Avatar answered Sep 26 '22 20:09

Benjol