typeclass

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2020 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MaxFloat

func MaxFloat(a, b ordFloat) ordFloat

func MaxInt

func MaxInt(a, b ordInt) ordInt

func MaxUint64

func MaxUint64(a, b ordUint64) ordUint64

func MinFloat

func MinFloat(a, b ordFloat) ordFloat

func MinInt

func MinInt(a, b ordInt) ordInt

func MinUint64

func MinUint64(a, b ordUint64) ordUint64

func NewFloat

func NewFloat(v float64) ordFloat

Types

type Eq

type Eq interface {
	Eq(Eq) bool
	NotEq(Eq) bool
}

type Ord

type Ord interface {
	Eq
	Lt(Ord) bool // <
	Le(Ord) bool // <=
	Gt(Ord) bool // >
	Ge(Ord) bool // >=
	Compare(Ord) Ordering
}

func Max

func Max(a, b Ord) Ord

func Min

func Min(a, b Ord) Ord

type OrdBytes

type OrdBytes interface {
	Ord
	Bytes() []byte
}

func MaxBytes

func MaxBytes(a, b OrdBytes) OrdBytes

func MinBytes

func MinBytes(a, b OrdBytes) OrdBytes

func NewBytes

func NewBytes(a []byte) OrdBytes

type OrdFloat

type OrdFloat interface {
	Ord
	Float() float64
}

type OrdInt

type OrdInt interface {
	Ord
	Int() int
}

func NewInt

func NewInt(v int) OrdInt

type OrdString

type OrdString interface {
	Ord
	String() string
}

func MaxString

func MaxString(a, b OrdString) OrdString

func MinString

func MinString(a, b OrdString) OrdString

func NewString

func NewString(a string) OrdString

type OrdUint64

type OrdUint64 interface {
	Ord
	Uint64() uint64
}

func NewUint64

func NewUint64(v uint64) OrdUint64

type Ordering

type Ordering int
const (
	LT Ordering = iota
	EQ
	GT
)

type Read

type Read interface {
	Read([]byte) ([]byte, error) // 返回尚未解析的字节数组
}

read失败时返回错误信息,出错时返回[]byte{}和出错信息

type Show

type Show interface {
	Show() []byte
}

show失败时返回[]byte{}

Jump to

Keyboard shortcuts

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