I have a seq<'A>. I want to map this to a seq<(int, 'A)>, where the integer is an auto-generated sequence of values starting at 0. I know I can do this with a mutable counter and a loop, but is there a more elegant way to do this, perhaps using Seq.map?
I have a seq<‘A> . I want to map this to a seq<(int, ‘A)>
Share
Check out
Seq.mapi: http://msdn.microsoft.com/en-us/library/ee340431.aspx