title: How can one specify the value type for an OCaml map
body: <p>I want to declare ahead of time the value type for a map type.</p>
  <p>The functor <code>Map.Make</code> returns a <code>Map.S</code> with two type definitions:</p>
  <pre><code>type key
  type !+'a t
  </code></pre>
  <p>Type <code>'a</code> appears to be the type of values in the map. For example, this is the function for adding a key (of type <code>key</code> and value of type <code>'a</code>:</p>
  <pre><code>    val add: key -&gt; 'a -&gt; 'a t -&gt; 'a t
  </code></pre>
  <p>One can write the key type like this:</p>
  <pre class="lang-ml prettyprint-override"><code>module type M = Map.S with type key = string
  </code></pre>
  <p>But I couldn't figure out how to specify the value type. This isn't valid syntax:</p>
  <pre class="lang-ml prettyprint-override"><code>module type M = Map.S with type key = string  and 'a = int
  </code></pre>