Question

I would like to make use of the Vector<'T> data structure mentioned here as an answer

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

but I can't seem to get the syntax right. For example:

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?

How do I create a vector of type Vector<int * float * string> and populate it with data?

Was it helpful?

Solution

The simplest way is to use the ofSeq method as follows

let myvector = myLstOfTuples |> Vector.ofSeq
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top