title: OCaml Summation
body: <p>I'm trying to make a function in OCaml which does the summation function in math.
  I tried this:</p>
  
  <pre><code>sum n m f =
      if n = 0 then 0
      else if n &gt; m then f
      else f + sum (n + 1) m f;;
  </code></pre>
  
  <p>However, I get an error - "Characters 41-44: else f * sum(n + 1) m f;; Error: Unbound value sum
  and sum is underlined (has carrot signs pointing to it)</p>
  
  <p>I looked at this: <a href="https://stackoverflow.com/questions/7775075/simple-ocaml-exercise">Simple OCaml exercise</a>
  It's the same question, but I see a lot of other things that I do not have.
  For example, for my n = m case, I do not have f n and then in the else case, I do not have f m.</p>
  
  <p>Why do you need f n if you want the function to return an integer? D:
  What's the problem!? Thanks in advance.</p>