title: F# type class persistent counter
body: <p>Gentlefolk,</p>
  
  <p>Old time procedural/deterministic programmer battling with F# functional....</p>
  
  <p>I require some counters to record counts from various areas of a program.
  The following code compiles clean and appears to work but "ctr" is never incremented.</p>
  
  <p>Any help appreciated, Ian</p>
  
  <pre><code>type Count() as this = 
      let mutable ctr = 0
      do
          printfn "Count:Constructor: %A" ctr
      member this.upctr : int = 
          let ctr  = ctr + 1 
          printfn "inCount.upctr %d" ctr
          ctr
  
  let myCount = new Count()
  printfn "MyCtr1 %d" (myCount.upctr)
  let fred = myCount.upctr
  let fred = myCount.upctr
  </code></pre>