pair

package
v0.0.0-...-6725145 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fst

func Fst[a, b any](p Data[a, b]) a

Pair left de-constructor

func Map

func Map[leftTarget, rightTarget, a, b any](pair Data[a, b]) mapper[a, b, leftTarget, rightTarget]

Pair map

func Snd

func Snd[a, b any](p Data[a, b]) b

Pair right de-constructor

Types

type Data

type Data[a, b any] struct {
	// contains filtered or unexported fields
}

func Ascend

func Ascend[a cmp.Ordered](p Data[a, a]) Data[a, a]

func Descend

func Descend[a cmp.Ordered](p Data[a, a]) Data[a, a]

func Make

func Make[a, b any](fst a, snd b) Data[a, b]

Pair constructor

func Max

func Max[a, b interface{ ~int | ~uint }](p1, p2 Data[a, b]) Data[a, b]

func MaxPositive

func MaxPositive[a, b interface{ ~int | ~uint }](p1, p2 Data[a, b]) Data[a, b]

func Min

func Min[a, b interface{ ~int | ~uint }](p1, p2 Data[a, b]) Data[a, b]

func MinPositive

func MinPositive[a, b interface{ ~int | ~uint }](p1, p2 Data[a, b]) Data[a, b]

func WeakenRange

func WeakenRange[a interface{ ~int | ~uint }](p1, p2 Data[a, a]) Data[a, a]

widens the range of the pair, reordering the values if necessary in ascending order

func (Data[a, b]) Both

func (p Data[a, b]) Both() (a, b)

Pair both de-constructor

type EmbedsPair

type EmbedsPair[a, b any] interface{ ~struct{ Data[a, b] } }

Jump to

Keyboard shortcuts

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