我有一段代码:
links
|> Seq.map (fun x -> x.GetAttributeValue ("href", "no url"))
Run Code Online (Sandbox Code Playgroud)
我想改写为:
links
|> Seq.map (fun x -> (x.GetAttributeValue "href" "no url"))
Run Code Online (Sandbox Code Playgroud)
但是F#编译器似乎并不喜欢这样.我认为这两个函数调用是可以互换的:
f (a, b)
(f a b)
Run Code Online (Sandbox Code Playgroud)
我得到的错误是:
无法从此代码位置访问带有2个参数的成员或对象构造函数"GetAttributeValue".方法'GetAttributeValue'的所有可访问版本都有2个参数.
这似乎很有趣,因为它似乎表明它需要我给它的东西.我在这里错过了什么?
f# ×1