title: OCaml function to evaluate arithmetic expressions
body: <p>I’ve written part of a mathematical calculator program. I’ve finished the parser of the program,
  so when a user types in a mathematical expression as a string, I already have a way to obtain
  a corresponding data structure of the following type:</p>
  <pre><code>type expression =
  | Term of int
  | Addition of expression * expression
  | Multiplication of expression * expression
  | Subtraction of expression * expression
  </code></pre>
  <p>All I need now is a way to evaluate these kinds of data structures.</p>
  <blockquote>
  <ul>
  <li>(a) Write the expression corresponding to the mathematical statement “3*((1 + 4)- 5).”</li>
  <li>(b) Extend the Ocaml datatype to include a Factorial constructor, so that it can handle
  expressions like “3*((1 + 4)! -5).”</li>
  <li>(c) Write an Ocaml function eval which takes a mathematical expression and returns its
  (integer) value. For example, it should return 0 as the result from the expression in part
  (a).</li>
  </ul>
  </blockquote>
  <blockquote>
  <pre><code> # let rec eval expr = ...
   val eval : expression -&gt; int = &lt;fun&gt;
  </code></pre>
  </blockquote>
  <blockquote>
  <p>You may want to write a factorial Ocaml function to help out with the new Factorial
  constructor.</p>
  </blockquote>
  <p>I'm confused about part a. Does it mean <code>let expression = 3*((1 + 4)- 5);</code>?</p>
  <p>For part b, should I follow the pattern <code>|Factorial of expression * expression</code>?</p>