Documentation ¶
Overview ¶
Package ordered contains ordered Pair and Triple types.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ordered ¶
type Ordered interface { ~int | ~int8 | ~int16 | ~int32 | ~int64 | ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr | ~float32 | ~float64 | ~string }
Ordered is a constraint that permits any ordered type: any type that supports the operators < <= >= >.
type Pair ¶
type Pair[T1, T2 Ordered] struct { F1 T1 F2 T2 }
Pair is two element tuple of ordered values.
func (Pair[T1, T2]) Compare ¶
Compare returns an integer comparing two pairs in natural order. The result will be 0 if p == other, -1 if p < other, and +1 if p > other.
type Triple ¶
type Triple[T1, T2, T3 Ordered] struct { V1 T1 V2 T2 V3 T3 }
Triple is three element tuple of ordered values.
func MakeTriple ¶
MakeTriple creates a new Triple.
func (Triple[T1, T2, T3]) Compare ¶
Compare returns an integer comparing two triples in natural order. The result will be 0 if t == other, -1 if t < other, and +1 if t > other.
Click to show internal directories.
Click to hide internal directories.