F#创建和填充FSharpx.Collections.Vector的语法是什么?

Chr*_*arn 4 syntax f# f#-3.0

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

/sf/answers/1257284311/

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

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?
Run Code Online (Sandbox Code Playgroud)

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

Joh*_*mer 5

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

let myvector = myLstOfTuples |> Vector.ofSeq
Run Code Online (Sandbox Code Playgroud)