title: F# using match to validate parameters
body: <p>I'm learning F#.  I want to know best practices for validating input parameters. In my naivety  I had thought I could do something like this:</p>
  
  <pre><code>let foo = match bar with
  | &lt;test for valid&gt; -&gt; bar
  | _ -&gt; "invalid"
  </code></pre>
  
  <p>of course that doesn't work due to mismatching types.  So I'd like to see the patterns experienced F# programmers use for this sort of thing.  match? If/then/else?</p>
  
  <p>Something else?</p>