title: See if key exists in a String Map
body: <p>I am currently using the Map functor to create a string map: <code>module StringMap = Map.Make(String)</code>. </p>
  
  <p>I then am trying to insert a set of mappings of strings to a list of <code>'a</code> objects into the StringMap. to check if the key already exists, I am doing the following: </p>
  
  <pre><code>match StringMap.find_opt key my_map with
    | None -&gt; StringMap.add key [child] my_map
    | Some l -&gt; StringMap.add key (child::l) my_map 
  </code></pre>
  
  <p>However, when I compile, I get an error saying the binding for <code>find_opt</code> has an unbound value, even though it is defined in the signature: <a href="https://ocaml.org/learn/tutorials/map.html" rel="nofollow noreferrer">https://ocaml.org/learn/tutorials/map.html</a>. </p>
  
  <p>I have also tried using <code>StringMap.mem key my_map</code>, but get the following error: </p>
  
  <pre><code>Error: This expression has type string but an expression was expected of type
       'a StringMap.t =
         (StringMap.Key.t, 'a, StringMap.Key.comparator_witness)
         Base__Map.t
  </code></pre>
  
  <p>I've looked around to see if there is a typing error or something but have been unable to find anything. Any ideas as to why I am getting either of these errors?</p>