title: Choice type in F#
body: <p>I'm getting some error with choice constructs, need help in fixing the code.</p>
  
  <p>The error is</p>
  
  <blockquote>
    <p>The 'if' expression needs to have type 'Choice' to satisfy context type requirements. It currently has type 'bool'. </p>
  </blockquote>
  
  <pre><code>let safeDiv num den : Choice&lt;string, bool&gt; = 
      if den = 0. then
          Choice1Of2 = "divide by zero"
      else 
          Choice2Of2 = (num/den)
  
  
  printfn "%s" (safeDiv 15. 3.).Choice1Of2
  </code></pre>