更新 : 2010 年 8 月
指定された述語がマップ内のすべてのバインディングについて true を返す場合に true を返します。
名前空間/モジュール パス: Microsoft.FSharp.Collections.Map
アセンブリ: FSharp.Core (FSharp.Core.dll 内)
// Signature:
Map.forall : ('Key -> 'T -> bool) -> Map<'Key,'T> -> bool (requires comparison)
// Usage:
Map.forall predicate table
パラメーター
戻り値
マップ内のすべてのバインディングについて、述語が true として評価される場合は true。
解説
この関数は、コンパイルされたアセンブリでは ForAll という名前です。 F# 以外の言語から、またはリフレクションを使用してこの関数にアクセスする場合は、この名前を使用します。
使用例
Map.forall の使用方法を次のコードに示します。
let map1 = Map.ofList [ (1, "one"); (2, "two"); (3, "three") ]
let map2 = Map.ofList [ (-1, "negative one"); (2, "two"); (3, "three") ]
let allPositive = Map.forall (fun key value -> key > 0)
printfn "%b %b" (allPositive map1) (allPositive map2)
出力
プラットフォーム
Windows 7、Windows Vista SP2、Windows XP SP3、Windows XP x64 SP2、Windows Server 2008 R2、Windows Server 2008 SP2、Windows Server 2003 SP2
バージョン情報
F# ランタイム
サポート対象: 2.0、4.0
Silverlight
サポート: 3
参照
その他の技術情報
Microsoft.FSharp.Collections 名前空間 (F#)
履歴の変更
日付 |
履歴 |
理由 |
---|---|---|
2010 年 8 月 |
コード例を追加。 |
情報の拡充 |