title: Tracing and debugging in OCaml
body: <p>What do you use for tracing and debugging in OCaml?</p>
  
  <p>For debugging I tried ocamldebug and the Emacs plugin.</p>
  
  <p>For tracing I want to be able to print the data constructor of every variable.
  An example using Camlp4 is shown here: <a href="http://caml.inria.fr/pub/docs/tutorial-camlp4/tutorial007.html#toc52" rel="noreferrer">http://caml.inria.fr/pub/docs/tutorial-camlp4/tutorial007.html#toc52</a></p>
  
  <pre><code>   type colour = Red | Green | Blue
     let print_colour =
       function
         Red -&gt; print_string "Red"
       | Green -&gt; print_string "Green"
       | Blue -&gt; print_string "Blue"
  </code></pre>