F# - keeping track of state
<p>I'm building a cache system in F#.  One of the things I want to do is keep track of the total cache hits and cache misses for the duration of the programs runtime.  So, for instance I may have a function like this:</p>

<pre><code>member this.Exists key =
            match HttpRuntime.Cache.Get(key) with
            | null -&gt; false
            | result -&gt; true
</code></pre>

<p>Where in the true null case I want to also increment a miss counter, and in the false case I want to also increment a hit counter.  Now I can use a mutable variable and do this no problem, but I'm wondering how one would go about this with a pure functional approach, or more idiomatic F# approach, with the end goal of being able to display the current count of cache hits and misses to user as the program runs.</p>