Reputation: 265
I have this noob problem that im trying to fix but I cant
I have an array of tuples in the form of
tuple: (string*(string*seq<string>)[])[]
I wish to convert the "seq" to the sequence length (int)
I tried in various forms with
Seq.length
but I haven't been able to do it, can anyone help? thanks!
Upvotes: 0
Views: 68
Reputation: 13577
This function will map the nested sequence to its length:
let map arg : (string*(string*int)[])[] =
arg |> Array.map (fun (s1, arr) ->
s1, arr |> Array.map (fun (s2, coll) -> s2, Seq.length coll))
But seeing how complex the type you have there is, I wonder do you represent with it? You'd almost certainly want to use something more palatable then this.
Upvotes: 1
Reputation: 26194
Array.map (fun (s,e) -> s, Array.map (fun (s,e) -> s, Seq.length e) e) tupArray
Upvotes: 1