title: Implementing iter for list in F#
body: <p>I am new to programming in functional languages. I am attempting to implement the F# iter for list. I think it should be similar to collect in list but not sure how to go around it. This is my attempted iter function for list in F#:</p>
  
  <pre><code>let rec iter func list =
      match list with
      | [] -&gt; []
      | hd::tl -&gt; func hd iter func tl;; 
  </code></pre>
  
  <p>The error of compilation is: <code>Type mismatch. Expecting a 'a but given a ('b -&gt; 'a -&gt; 'c -&gt; 'd -&gt; 'e list) -&gt; 'b list -&gt; 'e list The resulting type would be infinite when unifying ''a' and '('b -&gt; 'a -&gt; 'c -&gt; 'd -&gt; 'e list) -&gt; 'b list -&gt; 'e list'</code></p>
  
  <p>I'm not knowledgeable in F# to understand this error. If anyone could have some advices to guide me to a right direction I would really appreciate it. 
  Thanks
   `</p>