How to generate a bool Member Type via a static member New directly on the Measure type itself?
<p>How would I create a Measure Type in F# that would have a static member New that could be given a value and generate the given Measure Type for a bool?</p>

<p>I have this for int, int64, and decimal, which works perfectly.</p>

<pre><code>    [&lt;Measure&gt;] type MyInt = static member New value = value * 1&lt;MyInt&gt;
    [&lt;Measure&gt;] type MyInt64 = static member New value = value * 1L&lt;MyInt64&gt;
    [&lt;Measure&gt;] type MyDecimal = static member New value = value * 1m&lt;MyDecimal&gt;
</code></pre>

<p>But this doesn't work:</p>

<pre><code>    [&lt;Measure&gt;] type MyBool = static member New value = value * true&lt;MyBool&gt;
</code></pre>

<p>The compile error is <code>Unexpected token '&gt;' or incomplete expression</code></p>

<p>I have also run across this with string, and DateTime.  My goal is to basically use Measure types to provide compile time checking without the run time performance hit of the single case union type wrappers.  (<a href="https://stackoverflow.com/a/18815406/24908">See this answer by Jack P. for reference.</a>)</p>

<p>Ideally, I would love to use this concept for all of my types, but I'm not seeing how for types that are not numeric.</p>