title: Function overloading in OCaml
body: <p>I have defined some types:</p>
  
  <pre><code>type box = Box of int
  type table = Table of int
  type compare_result = Lt | Eq | Gt
  </code></pre>
  
  <p>It seems that in OCaml, we can't define 2 functions with same name but different types of arguments:</p>
  
  <pre><code>let compare (a: box) (b: box): compare_result = (...)
  let compare (a: table) (b: table): compare_result = (...)
  
  let res_box = compare (Box 1) (Box 2) in (* which is supposed to call the first funciton *) 
  let res_table = compare (Table 1) (Table 2) in (* which is supposed to call the second function *)
  </code></pre>
  
  <p>So could anyone tell me what is the alternative in OCaml to do this? Do we have to name these 2 functions differently?</p>