Discover Packages
github.com/siderolabs/gen
pair
ordered
package
Version:
v0.8.8
Opens a new window with list of versions in this module.
Published: Sep 10, 2026
License: MPL-2.0
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 5 modules, 2 packages
The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package ordered contains ordered Pair and Triple types.
type Ordered
type Pair
type Triple
func (t Triple[T1, T2, T3]) Compare(other Triple[T1, T2, T3]) int
func (t Triple[T1, T2, T3]) Equal(other Triple[T1, T2, T3]) bool
func (t Triple[T1, T2, T3]) LessThan(other Triple[T1, T2, T3]) bool
func (t Triple[T1, T2, T3]) MoreThan(other Triple[T1, T2, T3]) bool
Ordered is a constraint that permits any ordered type: any type
that supports the operators < <= >= >.
type Pair[T1, T2 Ordered ] struct {
F1 T1
F2 T2
}
Pair is two element tuple of ordered values.
func MakePair[T1, T2 Ordered ](v1 T1, v2 T2) Pair [T1, T2]
MakePair creates a new Pair.
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.
Equal checks if current pair is equal to the other.
LessThan checks if current pair is lesser than the other.
MoreThan checks if current pair is bigger than the other.
type Triple[T1, T2, T3 Ordered ] struct {
V1 T1
V2 T2
V3 T3
}
Triple is three element tuple of ordered values.
func MakeTriple[T1, T2, T3 Ordered ](v1 T1, v2 T2, v3 T3) Triple [T1, T2, T3]
MakeTriple creates a new Triple.
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.
Equal checks if current triple is equal to the other.
LessThan checks if current triple is lesser than the other.
MoreThan checks if current triple is bigger than the other.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.