Seq.concat<'Collection,'T> 関数 (F#)

指定された列挙体の列挙体を、1 つの連結された列挙体として結合します。

名前空間/モジュール パス: Microsoft.FSharp.Collections.Seq

アセンブリ: FSharp.Core (FSharp.Core.dll)

// Signature:
Seq.concat : seq<'Collection> -> seq<'T> (requires 'Collection :> seq<'T>)

// Usage:
Seq.concat sources

パラメーター

  • sources
    型: seq<'Collection>

    入力の列挙体の列挙体。

例外

例外

状態

ArgumentNullException

入力シーケンスが null の場合にスローされます。

戻り値

結果のシーケンス。

解説

返されたシーケンスは、スレッド間で安全に渡すことができます。ただし、返されたシーケンスから生成される個々の IEnumerator 値に同時にアクセスすることはできません。

この関数は、コンパイルされたアセンブリでは Concat という名前です。F# 以外の言語から、またはリフレクションを使用してこの関数にアクセスする場合は、この名前を使用します。

使用例

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

出力

  

プラットフォーム

Windows 8、Windows 7、Windows Server 2012 で Windows Server 2008 R2

バージョン情報

F# コア ライブラリのバージョン

サポート: ポータブル 2.0、4.0

参照

関連項目

Collections.Seq モジュール (F#)

Microsoft.FSharp.Collections 名前空間 (F#)