且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

F# 和 C# lambdas 之间的互操作

更新时间:2022-11-08 11:33:01

F# 为所有采用相应函数类型的 F# 值的委托类型提供构造函数.例如.在您的情况下,您想使用 System.Func<_ x> ...) 它应用生成的 ('a -> 'b) ->System.Func.

F# provides constructors for all delegate types that take F# values of the corresponding function types. E.g. in your case you want to use System.Func<_,_>(fun x -> ...) which applies the generated constructor of type ('a -> 'b) -> System.Func<'a, 'b>.