Documentation
¶
Overview ¶
Package unicmp provides generic ordering function for all comparable types.
The ordering is made by compares of one or more output of maphash function with different seeds. The resulting ordering is transitive and anticommutative, suitable for sorting and implementation of algorithms on top of sorted collections.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cmp ¶ added in v0.2.0
func Cmp[T comparable](x, y T) int
Cmp returns
-1 if x is less than y, 0 if x equals y, +1 if x is greater than y.
func Less ¶ added in v0.2.0
func Less[T comparable](x, y T) bool
Less returns true if x sorts before y (x < y).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.