title: Optional argument cannot be erased?
body: <p>I wanted to have a tail-recursive version of <code>List.map</code>, so I wrote my own.  Here it is:</p>
  
  <pre><code>let rec list_map f l ?(accum=[])=
    match l with
        head :: tail -&gt; list_map f tail ~accum:(head :: accum)
      | [] -&gt; accum;;
  </code></pre>
  
  <p>Whenever I compile this function, I get:</p>
  
  <pre><code>File "main.ml", line 69, characters 29-31:
  Warning X: this optional argument cannot be erased.
  </code></pre>
  
  <p>The <a href="http://www.ocaml-tutorial.org/common_error_messages" rel="noreferrer">tutorial</a> says that this means that I'm trying to create a function with no non-optional arguments.  But the function above clearly takes non-optional arguments.</p>
  
  <p>I'm probably just doing something really dumb, but what?</p>