title: Handy F# snippets
body: <p>There are already <a href="https://stackoverflow.com/questions/35940/elegant-snippets-of-f">two</a> <a href="https://stackoverflow.com/questions/832569/list-of-functional-code-snippets-for-procedural-programmers">questions</a> about F#/functional snippets.</p>
  
  <p>However what I'm looking for here are <strong>useful</strong> snippets, little 'helper' functions that are reusable. Or obscure but nifty patterns that you can never quite remember.</p>
  
  <p>Something like:</p>
  
  <pre><code>open System.IO
  
  let rec visitor dir filter= 
      seq { yield! Directory.GetFiles(dir, filter)
            for subdir in Directory.GetDirectories(dir) do 
                yield! visitor subdir filter} 
  </code></pre>
  
  <p>I'd like to make this a kind of handy reference page. As such there will be no right answer, but hopefully lots of good ones.</p>
  
  <p><strong>EDIT</strong> Tomas Petricek has created a site specifically for F# snippets <a href="http://fssnip.net/" rel="noreferrer">http://fssnip.net/</a>.</p>