将列表从C#传递到F#,如何指定参数为列表?

将列表从C#传递到F#,如何指定参数为列表?,f#,F#,使用以下C#代码 我不知道如何表示传入参数是一个列表 另外,是否需要将C类复制为F类型?您只需使用 open System let SomeFSharpFunc (MyList: System.Collections.Generic.List<MyClass>) = ... 开放系统 让SomeFSharpFunc(MyList:System.Collections.Generic.List)=。。。 但您应该考虑使用 SEQ (如果不需要完整的代码).Stask.Cuff.G

使用以下C#代码

我不知道如何表示传入参数是一个列表

另外,是否需要将C类复制为F类型?

您只需使用

open System

let SomeFSharpFunc (MyList: System.Collections.Generic.List<MyClass>) = ...
开放系统
让SomeFSharpFunc(MyList:System.Collections.Generic.List)=。。。

但您应该考虑使用<代码> SEQ (如果不需要完整的代码).Stask.Cuff.Gual.List< <代码>,特别是在F“列表”中通常指的是

另见

另外,我是否需要将C类复制为F类型

没有。

你可以用

open System

let SomeFSharpFunc (MyList: System.Collections.Generic.List<MyClass>) = ...
开放系统
让SomeFSharpFunc(MyList:System.Collections.Generic.List)=。。。

但您应该考虑使用<代码> SEQ (如果不需要完整的代码).Stask.Cuff.Gual.List< <代码>,特别是在F“列表”中通常指的是

另见

另外,我是否需要将C类复制为F类型


编号

System.Collections.Generic.List
System.Collections.Generic.List
open System

let SomeFSharpFunc (MyList: System.Collections.Generic.List<MyClass>) = ...