Given a class such as:
type MyClass() =
member this.Greet(x) = printfn "Hello %s" x
is it appropriate to initialize instances using
let x = new MyClass()
or without the new?
Also, when is the use of a new constructor more useful than a do binding with parameters supplied to the type definition?
My pattern in F# for using new is to only do so when the type implements
IDisposable. The compiler special cases this use and emits a warning ifnewis omitted.So in your case I would not use
new. But with the following I would