Documentation ¶
Index ¶
- func CompToEq[T any](comp types.Compare[T]) types.Equal[T]
- func CompToLess[T any](comp types.Compare[T]) types.Less[T]
- func InverseComp[T any](comp types.Compare[T]) types.Compare[T]
- func InverseLess[T any](less types.Less[T]) types.Less[T]
- func NewStrHash() types.Hash[string]
- func NumHash[T constraints.Integer | constraints.Float](n T) uint
- func ValueCompare[T constraints.Ordered](a, b T) int8
- func ValueEqual[T comparable](a, b T) bool
- func ValueGreater[T constraints.Ordered](a, b T) bool
- func ValueLess[T constraints.Ordered](a, b T) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompToLess ¶ added in v1.12.0
CompToLess is a high-order function that converts a types.Compare to a types.Less
func InverseComp ¶
InverseComp is a high-order function that changes a greater than types.Compare to a smaller than, and vice versa
func InverseLess ¶ added in v1.12.0
InverseLess is a high-order function that inverse a types.Less function
func NewStrHash ¶
NewStrHash returns a function closure of go native fnv.New32a or fnv.New64a depending on runtime platform
func NumHash ¶
func NumHash[T constraints.Integer | constraints.Float](n T) uint
NumHash simply returns the uint value, that means on a 32bit platform for a 64bit value, there would be considerable hash collisions in pattern.
func ValueCompare ¶
func ValueCompare[T constraints.Ordered](a, b T) int8
ValueCompare bounded by constraints.Ordered
func ValueEqual ¶
func ValueEqual[T comparable](a, b T) bool
ValueEqual bounded by native comparable
func ValueGreater ¶ added in v1.3.0
func ValueGreater[T constraints.Ordered](a, b T) bool
func ValueLess ¶ added in v1.3.0
func ValueLess[T constraints.Ordered](a, b T) bool
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.