我想使用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>
类型的向量并用数据填充它?
最佳答案
最简单的方法是使用 ofSeq
方法,如下所示
let myvector = myLstOfTuples |> Vector.ofSeq
关于syntax - F# 创建和填充 FSharpx.Collections.Vector 的语法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17964765/