funcs

package
v1.12.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 29, 2023 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompToEq

func CompToEq[T any](comp types.Compare[T]) types.Equal[T]

CompToEq is a high-order function that converts a types.Compare to an types.Equal

func CompToLess added in v1.12.0

func CompToLess[T any](comp types.Compare[T]) types.Less[T]

CompToLess is a high-order function that converts a types.Compare to a types.Less

func InverseComp

func InverseComp[T any](comp types.Compare[T]) types.Compare[T]

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

func InverseLess[T any](less types.Less[T]) types.Less[T]

InverseLess is a high-order function that inverse a types.Less function

func NewStrHash

func NewStrHash() types.Hash[string]

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL