title: Implementing tryFindIndex with option types in F#
body: <p>I am new to programming in functional languages. I am attempting to implement the F# tryFindIndex function.</p>
  
  <pre><code>let rec tryFindIndex func list =
      match list with
      | [] -&gt; None
      | hd::tl -&gt; if func hd then Some(0)
                  else (tryFindIndex func tl) + 1
  </code></pre>
  
  <p>The issue is with the last line, since adding 1 causes the return type to be 'int' instead of 'int option'. I need to track the index recursively.</p>