Set represented as ordered lists and related operations.
Try to change the functions that uses this module to use the standard SetModule.
This is a point where performance could possibly be greatly improved.
Function or value | Description |
Full Usage:
allnonemptysubsets s
Parameters:
'a list
-
The input 'set'.
Returns: 'a list list
All nonempty subsets of the input 'set'.
|
|
Full Usage:
allsets m l
Parameters:
int
-
The size of the subsets to be returned.
l : 'a list
-
The input 'set'.
Returns: 'a list list
All the subsets of the given size.
|
|
Full Usage:
allsubsets s
Parameters:
'a list
-
The input 'set'.
Returns: 'a list list
All the subsets of the input 'set'.
|
|
Full Usage:
image f s
Parameters:
'a -> 'b
-
The function to transform elements of the input 'set'.
s : 'a list
-
The input 'set'.
Returns: 'b list
A 'set' containing the transformed elements.
|
Returns a new collection containing the results of applying the given function to each element of the input 'set'.
Example
Evaluates to [2; 4; 6]
|
Full Usage:
insert x l
Parameters:
'a
-
The value to add.
l : 'a list
-
The input 'set'.
Returns: 'a list
A new 'set' containing x .
|
NoteCorresponds to the standard SetModule.Add. Example
Evaluates to [2;3;4;5] .
|
Full Usage:
intersect l1 l2
Parameters:
'a list
-
The first input list.
l2 : 'a list
-
The second input list.
Returns: 'a list
The intersection of the two lists.
|
NoteCorresponds to the standard SetModule.Intersect. Example
Evaluates to [1;3] .
Example
Evaluates to [1;2] .
|
Full Usage:
mem value source
Parameters:
'a
-
The value to locate in the input list.
source : 'a list
-
The input list.
Returns: bool
True if the input list contains the specified element; false otherwise.
|
NoteIt's just an alias for ListModule.Contains. Example
Evaluates to false .
Example
Evaluates to true .
Example
Evaluates to true .
Example
Evaluates to false .
|
Full Usage:
psubset l1 l2
Parameters:
'b list
-
The potential subset.
l2 : 'b list
-
The set to test against.
Returns: bool
true if l1 is a proper subset of l2 .
|
NoteCorresponds to the standard SetModule.IsProperSubset. Example
Evaluates to true .
Example
Evaluates to false .
Example
Evaluates to false .
|
Full Usage:
set_eq l1 l2
Parameters:
'a list
-
The first list.
l2 : 'a list
-
The second list.
Returns: bool
true if l1 and l2 are equal seen as sets.
|
In other words, it tests if the lists are the same considered as sets, i.e. ignoring duplicates.
Example
Evaluates to true .
Example
Evaluates to false .
|
Full Usage:
setify l
Parameters:
'a list
-
The input list.
Returns: 'a list
The result list.
|
Returns a sorted list that contains no duplicate entries according to generic hash and equality comparisons on the entries. If an element occurs multiple times in the list then the later occurrences are discarded.
Example
Evaluates to [1;2;3;4] .
|
Full Usage:
subset l1 l2
Parameters:
'a list
-
The potential subset.
l2 : 'a list
-
The set to test against.
Returns: bool
true if l1 is a subset of l2 .
|
NoteCorresponds to the standard SetModule.IsSubset. Example
Evaluates to true .
Example
Evaluates to true .
Example
Evaluates to false .
|
Full Usage:
subtract l1 l2
Parameters:
'a list
-
The first input list.
l2 : 'a list
-
The list whose elements will be removed from l1 .
Returns: 'a list
The list with the elements of l2 removed from l1 .
|
NoteCorresponds to the standard SetModule.Difference. Example
Evaluates to [2] .
Example
Evaluates to [1;2] .
|
Full Usage:
union l1 l2
Parameters:
'a list
-
The first input list.
l2 : 'a list
-
The second input list.
Returns: 'a list
The union of the two lists.
|
NoteCorresponds to the standard SetModule.Union. Example
Evaluates to [1;2;3;4;5] .
Example
Evaluates to [1;2;3] .
|
Full Usage:
unions s
Parameters:
'a list list
-
The sequence of 'sets' to union.
Returns: 'a list
The union of the input 'sets'.
|
NoteCorresponds to the standard SetModule.UnionMany. Example
Evaluates to [1; 2; 3; 4; 5; 6] .
|