Set.intersect<'T> Function (F#)
Computes the intersection of the two sets.
Namespace/Module Path: Microsoft.FSharp.Collections.Set
Assembly: FSharp.Core (in FSharp.Core.dll)
// Signature:
Set.intersect : Set<'T> -> Set<'T> -> Set<'T> (requires comparison)
// Usage:
Set.intersect set1 set2
Parameters
Return Value
The intersection of set1 and set2.
Remarks
This function is named Intersect in compiled assemblies. If you are accessing the function from a language other than F#, or through reflection, use this name.
Example
The following code illustrates the use of the Set.intersect function.
let set1 = Set.ofList [ 1 .. 3 ]
let set2 = Set.ofList [ 2 .. 6 ]
let setIntersect = Set.intersect set1 set2
printfn "Set.intersect [1 .. 3] [2 .. 6] yields %A" setIntersect
Output
Set.intersect [1 .. 3] [2 .. 6] yields set [2; 3]
Platforms
Windows 7, Windows Vista SP2, Windows XP SP3, Windows XP x64 SP2, Windows Server 2008 R2, Windows Server 2008 SP2, Windows Server 2003 SP2
Version Information
F# Runtime
Supported in: 2.0, 4.0
Silverlight
Supported in: 3
See Also
Reference
Microsoft.FSharp.Collections Namespace (F#)
Change History
Date |
History |
Reason |
---|---|---|
May 2010 |
Added code example. |
Information enhancement. |