title: Using Seq functions on an IEnumerable
body: <p>I'm trying to apply Seq functions on an IEnumerable. More specifically, it's <code>System.Windows.Forms.HtmlElementCollection</code> which implements <code>ICollection</code> and <code>IEnumerable</code>.</p>
  
  <p>Since an F# <code>seq</code> is an IEnumerable, I thought I could write</p>
  
  <pre><code>let foo = myHtmlElementCollection |&gt; Seq.find (fun i -&gt; i.Name = "foo")
  </code></pre>
  
  <p>but the compiler will have none of it, and complains that <em>"The type 'HtmlElementCollection' is not compatible with the type 'seq&lt;'a>'"</em>.</p>
  
  <p>However, the compiler willingly accepts the IEnumerable in a <code>for .. in ..</code> sequence expression:</p>
  
  <pre><code>let foo = seq { for i in myHtmlElementCollection -&gt; i } |&gt; Seq.find (fun i -&gt; i.Name = "foo")
  </code></pre>
  
  <p>What do I need to do in order for the IEnumerable to be treated just like any old F# <code>seq</code>?</p>
  
  <p><strong>NB:</strong> This question is marked as a duplicate, but it's not. The linked "duplicate" is about <em>untyped</em> sequences (a seq from the seq { for ... } expression), whereas my question is about <em>typed</em> sequences.</p>