Set.isProperSubset<'T> Function (F#)
Visual Studio 2012
Evaluates to true if all elements of the first set are in the second, and at least one element of the second is not in the first.
Namespace/Module Path: Microsoft.FSharp.Collections.Set
Assembly: FSharp.Core (in FSharp.Core.dll)
// Signature: Set.isProperSubset : Set<'T> -> Set<'T> -> bool (requires comparison) // Usage: Set.isProperSubset set1 set2
The following code illustrates the use of the Set.isProperSubset function.
let set1 = Set.ofList [ 1 .. 6 ] let set2 = Set.ofList [ 1 .. 5 ] let set3 = Set.ofList [ 1 .. 6 ] let set4 = Set.ofList [ 5 .. 10 ] printfn "%A is a proper subset of %A: %b" set2 set1 (Set.isProperSubset set2 set1) printfn "%A is a proper subset of %A: %b" set3 set1 (Set.isProperSubset set3 set1) printfn "%A is a proper subset of %A: %b" set4 set1 (Set.isProperSubset set4 set1)
Output
set [1; 2; 3; 4; 5] is a proper subset of set [1; 2; 3; 4; 5; 6]: true set [1; 2; 3; 4; 5; 6] is a proper subset of set [1; 2; 3; 4; 5; 6]: false set [5; 6; 7; 8; 9; 10] is a proper subset of set [1; 2; 3; 4; 5; 6]: false