title: F# pattern matching when mixing DU's and other values
body: <p>What would be the most effective way to express the following code?</p>
  
  <pre><code>match cond.EvalBool() with
  | true -&gt;                
      match body.Eval() with
      | :? ControlFlowModifier as e -&gt;
          match e with
          | Break(scope) -&gt; e :&gt; obj //Break is a DU element of ControlFlowModifier
          | _ -&gt; next() //other members of CFM should call next()
      | _ -&gt; next() //all other values should call next()
  | false -&gt; null
  </code></pre>
  
  <p>cond.EvalBool returns a boolean result where false should return null
  and true should either run the entire block again (its wrapped in a func called next)
  or if the special value of break is found, then the loop should exit and return the break value.</p>
  
  <p>Is there any way to compress that block of code to something smaller?</p>