title: F# measure unit : from radians to velocity in m/s
body: <p>let's say I've defined an F# module for handling 3-dimensional vectors and measure unit:</p>
  
  <pre><code>[&lt;Measure&gt;]
  type m
  [&lt;Measure&gt;]
  type s
  [&lt;Measure&gt;]
  type v = m/s
  [&lt;Measure&gt;]
  type rad
  
  type Vector3&lt;[&lt;Measure&gt;] 'a&gt; =
      {
      X : float&lt;'a&gt;
      Y : float&lt;'a&gt;
      Z : float&lt;'a&gt;
      }
  </code></pre>
  
  <p>And somewhere I have an angle expressed in radians:</p>
  
  <pre><code>let angle:float32&lt;rad&gt; = 0.5f&lt;rad&gt;
  </code></pre>
  
  <p>Now I have to declare a Vector3 (velocity) using the angle to calculate its components. I tried something like :</p>
  
  <pre><code>let velocity : Vector3&lt;m/s&gt; = { X = Math.Cos(angle);Y = Math.Sin(angle);Z = 0.0&lt;m/s&gt;} //don't compile
  </code></pre>
  
  <p>The code above doesn't compile because Vector3 is expecting a  value in X and Y but Sin returns a float. </p>
  
  <p>How can I solve this problem? If it possible I would like to perform a conversion between measure units, instead of a cast, in such a way that the compiler can guarantee that I'm doing the right thing while transforming an angle into a velocity.</p>
  
  <p>Any suggestion?</p>