If you are only accessing an interface, you do not need to define members in the type itself. Phil’s answer is good if you want minimalism, but a different approach. I like to use “let-bound” values rather than members - for more complex code it's better to use type inference and they are usually easier to deal with members.
type MyType() = let mutable myProp = true let myMethod() = if myProp then () else () interface IMyInterface with member __.MyProp with get() = myProp and set v = myProp <- v member __.MyMethod() = myMethod()
The code is a little cleaner than the member versions, like imo, because the self tag in type MyType() as self is only required to access the elements. Available values can be accessed directly from the interface.
Grundoon
source share