Documentation
¶
Index ¶
- Constants
- func EqByKey[A any, F func(A) K, K Eq[K]](f F, lhs, rhs A) bool
- func Max[A Ord[A]](lhs A, rhs A) A
- func MaxBy[A any, F func(A, A) Ordering](compare F, lhs, rhs A) A
- func MaxByKey[A any, F func(A) K, K Ord[K]](f F, lhs, rhs A) A
- func MaxOrdered[A core.Ordered](lhs, rhs A) A
- func Min[A Ord[A]](lhs, rhs A) A
- func MinBy[A any, F func(A, A) Ordering](compare F, lhs, rhs A) A
- func MinByKey[A any, F func(A) K, K Ord[K]](f F, lhs, rhs A) A
- func MinOrdered[A core.Ordered](lhs, rhs A) A
- type Eq
- type EqFunc
- type Ord
- type OrdFunc
- type Ordering
- type PartialEq
- type PartialOrd
Constants ¶
View Source
const ( // Less is an Ordering where a compared value is less than another Less = order(-1) // Equal is an Ordering where a compared value is equal to another Equal = order(0) // Greater is an Ordering where a compared value is greater than another Greater = order(1) )
Variables ¶
This section is empty.
Functions ¶
func MaxOrdered ¶
MaxOrdered calculates the maximum value of two ordered values.
func MinOrdered ¶
MinOrdered calculates the minimum value of two ordered values.
Types ¶
type Eq ¶
Eq is a type that represents an equality comparison.
see: [Eq](https://en.wikipedia.org/wiki/Equivalence_relation)
type Ord ¶
type Ord[A any] interface { Eq[A] PartialOrd[A] Cmp(A) Ordering }
Ord is a type that represents an ordered value.
see: [Ord](https://en.wikipedia.org/wiki/Total_order)
type Ordering ¶
type Ordering interface { IsEq() bool IsNe() bool IsLt() bool IsLe() bool IsGt() bool IsGe() bool fmt.Stringer // contains filtered or unexported methods }
Ordering is a type that represents the ordering of two values.
Click to show internal directories.
Click to hide internal directories.