EqualityComparer Module
Factory for ad hoc IEqualityComparer{T} instances — for when a Dictionary{TKey,TValue}, HashSet{T}, or LINQ overload needs a custom key comparer but a full named type isn't worth declaring.
Functions and values
| Function or value |
Description
|
Full Usage:
EqualityComparer.create equals getHashCode
Parameters:
'a -> 'a -> bool
-
The equality function.
getHashCode : 'a -> int
-
The hash function.
Returns: IEqualityComparer<'a>
|
Creates an IEqualityComparer{T} from an explicit equality function and hash function.
Example
val ordinalIgnoreCase: obj
Multiple items
val string: value: 'T -> string -------------------- type string = System.String module String
from Microsoft.FSharp.Core
val set: obj
|
Full Usage:
EqualityComparer.createBy projection
Parameters:
'a -> 'b
-
The function extracting the comparison key from an element.
Returns: IEqualityComparer<'a>
|
Creates an IEqualityComparer{T} that compares and hashes elements by a projected key, using the key's own structural equality and hash code.
Example
val byId: obj
val set: obj
|
TDesu.FSharp