title: How to quit an iteration in OCaml?
body: <p>I try to go through a list <code>xl</code> by <code>List.fold_left</code>, I would like to quit the iteration when some condition is satisfied:</p>
  
  <pre><code>List.fold_left
    (fun x acc -&gt; 
       if x = 5 then STOP THE ITERATION
       else x + acc)
  xl
  </code></pre>
  
  <p>Could anyone tell me how to express <code>STOP THE ITERATION</code> here? Thank you</p>
  
  <p><strong>Edit1:</strong> By the code above, I would like to say we do not stop accumulation until we meet the first <code>5</code>. </p>