Is there a built-in method to convert the .NET List<> into the F# list?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Generic Generics in Managed C++
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
Given
IEnumerable<T> foo
you would do the following (in C#) to get an F#list<T>
:ListModule
refers toMicrosoft.FSharp.Collections.ListModule
, and is referred to asList
from within F# itself.Try
List.ofSeq
in theMicrosoft.FSharp.Collections
namespace.It's not specifically for
System.Collections.Generic.List<T>
, but forIEnumerable<T>
(seq<'T>
in F#) types in general, so it should still work.(It's also not strictly built into the F# language, but neither is
List<T>
built into C# or VB.NET. Those are all part of the respective standard libraries.)