4

我想利用Vector<'T>这里提到的数据结构作为答案

https://stackoverflow.com/a/17961204/818645

但我似乎无法正确使用语法。例如:

open FSharpx.Collections

let tuple1= (1,2.0,"f")
let tuple2= (2,3.0,"f")

let myLstOfTuples = [tuple1;tuple2]  
let myVector = ?? <- how do I do this?

如何创建类型向量Vector<int * float * string>并用数据填充它?

4

1 回答 1

5

最简单的方法是使用ofSeq方法如下

let myvector = myLstOfTuples |> Vector.ofSeq
于 2013-07-31T08:08:08.373 回答