Seq.concat<'Collection,'T> Function (F#)
Visual Studio 2012
Combines the given enumeration-of-enumerations as a single concatenated enumeration.
Namespace/Module Path: Microsoft.FSharp.Collections.Seq
Assembly: FSharp.Core (in FSharp.Core.dll)
// Signature: Seq.concat : seq<'Collection> -> seq<'T> (requires 'Collection :> seq<'T>) // Usage: Seq.concat sources
The returned sequence may be passed between threads safely. However, individual IEnumerator values generated from the returned sequence should not be accessed concurrently.
This function is named Concat in compiled assemblies. If you are accessing the function from a language other than F#, or through reflection, use this name.
The following code shows how to use Seq.concat.
// Using Seq.append to append an array to a list. let seq1to10 = Seq.append [1; 2; 3] [| 4; 5; 6; 7; 8; 9; 10 |] // Using Seq.concat to concatenate a list of arrays. let seqResult = Seq.concat [ [| 1; 2; 3 |]; [| 4; 5; 6 |]; [|7; 8; 9|] ] Seq.iter (fun elem -> printf "%d " elem) seq1to10 printfn "" Seq.iter (fun elem -> printf "%d " elem) seqResult
Output
1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9