58 votesAnonymous commented
f : int -> int -> int
let f x y = x * y
M : int -> int
member this.M(x) = x + 4
same for let recAnonymous supported this idea ·
168 votesAnonymous commented
I think it is critical to look at the different versions of this concept and how they evolved in Haskell -- my understanding, weak as it may be, is that it took a while to get to ekmett's package and that is the one that you would want to model it after.
One key thing that you want to preserve would be in addition to a regular getters and setters, you want the ability to set a value with function that uses the original value. For example, if you have a property that is an integer, you should be able to set it with an incrementing function:
f x = x + 1
and all of the variations that you might want with that.