base

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: MIT Imports: 1 Imported by: 2

Documentation

Index

Constants

View Source
const (
	OrderingLessThan    = "OrderingLessThan"
	OrderingEqual       = "OrderingEqual"
	OrderingGreaterThan = "OrderingGreaterThan"
)

Variables

This section is empty.

Functions

func Equal

func Equal[T Eq[T]](a T, b T) bool

func First

func First[A, B any](p *Pair[A, B]) A

func GreaterThan

func GreaterThan[T Ord[T]](a T, b T) bool

func GreaterThanOrEqual

func GreaterThanOrEqual[T Ord[T]](a T, b T) bool

func LessThan

func LessThan[T Ord[T]](a T, b T) bool

func LessThanOrEqual

func LessThanOrEqual[T Ord[T]](a T, b T) bool

func Max

func Max[T Ord[T]](a T, b T) T

func Min

func Min[T Ord[T]](a T, b T) T

func NotEqual

func NotEqual[T Eq[T]](a T, b T) bool

func Second

func Second[A, B any](p *Pair[A, B]) B

func UnwrapBool

func UnwrapBool(a Bool) bool

func UnwrapComplex128

func UnwrapComplex128(a Complex128) complex128

func UnwrapComplex64

func UnwrapComplex64(a Complex64) complex64

func UnwrapFloat32

func UnwrapFloat32(a Float32) float32

func UnwrapFloat64

func UnwrapFloat64(a Float64) float64

func UnwrapInt

func UnwrapInt(a Int) int

func UnwrapInt16

func UnwrapInt16(a Int16) int16

func UnwrapInt32

func UnwrapInt32(a Int32) int32

func UnwrapInt64

func UnwrapInt64(a Int64) int64

func UnwrapInt8

func UnwrapInt8(a Int8) int8

func UnwrapString

func UnwrapString(a String) string

func UnwrapUint

func UnwrapUint(a Uint) uint

func UnwrapUint16

func UnwrapUint16(a Uint16) uint16

func UnwrapUint32

func UnwrapUint32(a Uint32) uint32

func UnwrapUint64

func UnwrapUint64(a Uint64) uint64

func UnwrapUint8

func UnwrapUint8(a Uint8) uint8

func UnwrapUintptr

func UnwrapUintptr(a Uintptr) uintptr

Types

type Bool

type Bool bool

func WrapBool

func WrapBool(a bool) Bool

func (Bool) Compare

func (a Bool) Compare(b Bool) Ordering

func (Bool) Equal

func (a Bool) Equal(b Bool) bool

type Comparator

type Comparator[A any] func(A, A) Ordering

func ConstComparator added in v0.1.1

func ConstComparator[T any](a Ordering) Comparator[T]

type Complex128

type Complex128 complex128

func WrapComplex128

func WrapComplex128(a complex128) Complex128

func (Complex128) Equal

func (a Complex128) Equal(b Complex128) bool

type Complex64

type Complex64 complex64

func WrapComplex64

func WrapComplex64(a complex64) Complex64

func (Complex64) Equal

func (a Complex64) Equal(b Complex64) bool

type Eq

type Eq[T any] interface {
	Equal(T) bool
}

type Equaler

type Equaler[A any] func(A, A) bool

type F1

type F1[A, Z any] func(A) Z

type F2

type F2[A, B, Z any] func(A, B) Z

type F3

type F3[A, B, C, Z any] func(A, B, C) Z

type F4

type F4[A, B, C, D, Z any] func(A, B, C, D) Z

type F5

type F5[A, B, C, D, E, Z any] func(A, B, C, D, E) Z

type Float32

type Float32 float32

func WrapFloat32

func WrapFloat32(a float32) Float32

func (Float32) Compare

func (a Float32) Compare(b Float32) Ordering

func (Float32) Equal

func (a Float32) Equal(b Float32) bool

type Float64

type Float64 float64

func WrapFloat64

func WrapFloat64(a float64) Float64

func (Float64) Compare

func (a Float64) Compare(b Float64) Ordering

func (Float64) Equal

func (a Float64) Equal(b Float64) bool

type Int

type Int int

func WrapInt

func WrapInt(a int) Int

func (Int) Compare

func (a Int) Compare(b Int) Ordering

func (Int) Equal

func (a Int) Equal(b Int) bool

type Int16

type Int16 int16

func WrapInt16

func WrapInt16(a int16) Int16

func (Int16) Compare

func (a Int16) Compare(b Int16) Ordering

func (Int16) Equal

func (a Int16) Equal(b Int16) bool

type Int32

type Int32 int32

func WrapInt32

func WrapInt32(a int32) Int32

func (Int32) Compare

func (a Int32) Compare(b Int32) Ordering

func (Int32) Equal

func (a Int32) Equal(b Int32) bool

type Int64

type Int64 int64

func WrapInt64

func WrapInt64(a int64) Int64

func (Int64) Compare

func (a Int64) Compare(b Int64) Ordering

func (Int64) Equal

func (a Int64) Equal(b Int64) bool

type Int8

type Int8 int8

func WrapInt8

func WrapInt8(a int8) Int8

func (Int8) Compare

func (a Int8) Compare(b Int8) Ordering

func (Int8) Equal

func (a Int8) Equal(b Int8) bool

type Ord

type Ord[T any] interface {
	Eq[T]
	Compare(T) Ordering
}

type Ordering

type Ordering string

func Compare

func Compare[A Ord[A]](x A, y A) Ordering

func FlipOrdering

func FlipOrdering(a Ordering) Ordering

func (Ordering) Compare

func (a Ordering) Compare(b Ordering) Ordering

func (Ordering) Equal

func (a Ordering) Equal(b Ordering) bool

func (Ordering) Flip added in v0.1.1

func (a Ordering) Flip() Ordering

type Pair

type Pair[A, B any] struct {
	Fst A
	Snd B
}

func NewPair

func NewPair[A, B any](a A, b B) *Pair[A, B]

type String

type String string

func WrapString

func WrapString(a string) String

func (String) Compare

func (a String) Compare(b String) Ordering

func (String) Equal

func (a String) Equal(b String) bool

type Uint

type Uint uint

func WrapUint

func WrapUint(a uint) Uint

func (Uint) Compare

func (a Uint) Compare(b Uint) Ordering

func (Uint) Equal

func (a Uint) Equal(b Uint) bool

type Uint16

type Uint16 uint16

func WrapUint16

func WrapUint16(a uint16) Uint16

func (Uint16) Compare

func (a Uint16) Compare(b Uint16) Ordering

func (Uint16) Equal

func (a Uint16) Equal(b Uint16) bool

type Uint32

type Uint32 uint32

func WrapUint32

func WrapUint32(a uint32) Uint32

func (Uint32) Compare

func (a Uint32) Compare(b Uint32) Ordering

func (Uint32) Equal

func (a Uint32) Equal(b Uint32) bool

type Uint64

type Uint64 uint64

func WrapUint64

func WrapUint64(a uint64) Uint64

func (Uint64) Compare

func (a Uint64) Compare(b Uint64) Ordering

func (Uint64) Equal

func (a Uint64) Equal(b Uint64) bool

type Uint8

type Uint8 uint8

func WrapUint8

func WrapUint8(a uint8) Uint8

func (Uint8) Compare

func (a Uint8) Compare(b Uint8) Ordering

func (Uint8) Equal

func (a Uint8) Equal(b Uint8) bool

type Uintptr

type Uintptr uintptr

func WrapUintptr

func WrapUintptr(a uintptr) Uintptr

func (Uintptr) Compare

func (a Uintptr) Compare(b Uintptr) Ordering

func (Uintptr) Equal

func (a Uintptr) Equal(b Uintptr) bool

Jump to

Keyboard shortcuts

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