即同名方法/函数对不同函数签名的重载。F#不允许重载function,但可以重载method。
type Product = {SKU:string; Price: float} with
member this.TupleTotal3(qty) =
this.Price * float qty
member this.TupleTotal3(qty, discount) =
(this.Price * float qty) - discount
代码来源: