title: This expression has type unit but an expression was expected of type int
body: <p>I have a bug in my program in OCaml and I am looking for help.</p>
  
  <p>the error: </p>
  
  <pre><code>This expression has type unit but an expression was expected of type int
  </code></pre>
  
  <p>The line error with the error contains <code>soma = soma</code></p>
  
  <pre><code>let soma = 0;;
  let rec nBell n = 
  if n == 0 then 1 
      else
          for k=0 to n-1 do 
          soma = soma + ((fact(n-1)/(fact(k)*fact((n-1)-k))) * nBell(k));
              done;;`
  </code></pre>
  
  <p>Can anyone help me?</p>