title: Match Comparison OCaml
body: <p>I have come to love this syntax in OCaml</p>
  
  <pre><code>match myCompare x y with
  |Greater-&gt;
  |Less-&gt;
  |Equal-&gt;
  </code></pre>
  
  <p>However, it needs 2 things, a custom type, and a myCompare function that returns my custom type.</p>
  
  <p>Would there be anyway to do this without doing the steps above?</p>
  
  <p>The pervasives module seems to have 'compare' which returns 0 if equal, pos int when greater and neg int when less. Is it possible to match those? Conceptually like so (which does not compile):</p>
  
  <pre><code>match myCompare x y with
  | (&gt;0) -&gt;
  | (0)  -&gt;
  | (&lt;0) -&gt;
  </code></pre>
  
  <p>I know I could just use if statements, but pattern matching is more elegant to me. Is there an easy (if not maybe standard) way of doing this?</p>