Help us shape the future of Go! Take the 2026 Go Developer Survey

eq

package
v1.1.84 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contramap

func Contramap[A, B any](f func(b B) A) func(Eq[A]) Eq[B]

Contramap implements an Equals predicate based on a mapping

func Equals

func Equals[T any](eq Eq[T]) func(T) func(T) bool

Equals returns a predicate to test if one value equals the other under an equals predicate

func Monoid

func Monoid[A any]() M.Monoid[Eq[A]]

func Semigroup

func Semigroup[A any]() S.Semigroup[Eq[A]]

Types

type Eq

type Eq[T any] interface {
	Equals(x, y T) bool
}

func Empty

func Empty[T any]() Eq[T]

Empty returns the equals predicate that is always true

func FromEquals

func FromEquals[T any](c func(x, y T) bool) Eq[T]

FromEquals constructs an [EQ.Eq] from the comparison function

func FromStrictEquals

func FromStrictEquals[T comparable]() Eq[T]

FromStrictEquals constructs an [EQ.Eq] from the canonical comparison function

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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