Google News
logo
F# - Interview Questions
What is Sequence in F#?
The Sequence is a series of the same type of elements. It provides better performance than list.
 
Example : 
You can create sequence expression like following. Here, we have used Seq.iter () function to iterate sequence. We can also use for loop or array format specifier to iterate sequence elements.

let seq1 =  
 seq { 0 .. 10 }  
Seq.iter(fun a->printf " %d" a)seq1
Advertisement