title: Converting a polymorphic type to a string ( 'a -> string)
body: <p>Given the following type definition:</p>
  
  <pre><code>type 'a range = Full | Range of ('a * 'a);;
  </code></pre>
  
  <p>How do I convert values of this type to strings?</p>
  
  <p>I currently have:</p>
  
  <pre><code>let string_of_range r = match r with
    | Full -&gt; "Full"
    | Range(a,b) -&gt; "Range("^(string_of_int a)^","^(string_of_int b)^")";; 
  </code></pre>
  
  <p>But of course, this says that a and b are of type int.  They could also be floats or chars (see my previous question about constraining the type)</p>