F# 列表上的扩展方法?
如何在F#列表上定义扩展方法 像这样天真的尝试会导致错误:F# 列表上的扩展方法?,f#,extension-methods,F#,Extension Methods,如何在F#列表上定义扩展方法 像这样天真的尝试会导致错误: type list with member this.abc() = 100 键入Microsoft.FSharp.Collections.List正确的语法是: type List<'a> with member this.abc() = 100 type List<'a> with member this.abc() = 100 module List = let ab
type list with
member this.abc() = 100
键入Microsoft.FSharp.Collections.List正确的语法是:
type List<'a> with
member this.abc() = 100
type List<'a> with
member this.abc() = 100
module List =
let abc (xs: _ list) = 100