title: How could you recreate the List.iter function in ocaml?
body: <p>I'm quite new to the Ocaml language and in general a newbie in programming. So I feel like this question is very basic but here it is:
  I would like to recreate the <code>List.iter</code> function in Ocaml to understand it better and because I've been asked to by my teacher. 
  Here's what I've done :</p>
  
  <pre><code>let rec iter f = function
  |[]-&gt;()
  |e::q-&gt; f e (iter f q);;
  </code></pre>
  
  <p>My two very simple problems are </p>
  
  <ol>
  <li>I don't really understand how <code>List.iter</code> works </li>
  <li>this results in ('a -> unit -> unit) -> 'a list -> unit =  and I know my 'f' should only be a<br>
  'a->unit and I don't know how to change it </li>
  </ol>
  
  <p>(If I made any mistakes, I'm sorry, my native language is french)</p>