title: How do I properly implement a property in F#?
body: <p>Consider my first attempt, a simple type in F# like the following:</p>
  
  <pre><code>type Test() =
      inherit BaseImplementingNotifyPropertyChangedViaOnPropertyChanged()
      let mutable prop: string = null
      member this.Prop
          with public get() = prop
          and public set value =
              match value with
                  | _ when value = prop -&gt; ()
                  | _ -&gt; 
                      let prop = value
                      this.OnPropertyChanged("Prop")
  </code></pre>
  
  <p>Now I test this via C# (this object is being exposed to a C# project, so apparent C# semantics are desirable):</p>
  
  <pre><code>[TestMethod]
  public void TaskMaster_Test()
  {
      var target = new FTest();
      string propName = null;
      target.PropertyChanged += (s, a) =&gt; propName = a.PropertyName;
      target.Prop = "newString";
  
      Assert.AreEqual("Prop", propName);
      Assert.AreEqual("newString", target.Prop);
  
      return;
  }
  </code></pre>
  
  <p><code>propName</code> is properly assigned, my F# Setter is running, but the second assert is failing because the underlying value of <code>prop</code> isn't changed.  This sort of makes sense to me, because if I remove <code>mutable</code> from the <code>prop</code> field, no error is generated (and one should be because I'm trying to mutate the value).  I think I must be missing a fundamental concept.</p>
  
  <p>What's the correct way to rebind/mutate <code>prop</code> in the <code>Test</code> class so that I can pass my unit test?</p>