Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
除了定义你自己的身份函数(fun x -> x)之外,是否有更短的标识函数?写作
Seq.countBy (fun x -> x)
看起来很罗嗦。
有一个简短的版本id等于fun x -> x
id
fun x -> x
另外,对于您的情况,您可以这样做Seq.sort
Seq.sort