tuple

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equal added in v0.3.0

func Equal[T comparable](t1, t2 Tuple[T]) bool

Equal reports whether t1 == t2

Types

type Empty

type Empty[T any] struct{}

Empty tuple

func (Empty[T]) At

func (Empty[T]) At(i int) T

func (Empty[T]) Len

func (Empty[T]) Len() int

type Tuple

type Tuple[T any] interface {
	Len() int
	At(i int) T
}

Tuple holds n values

func Concat

func Concat[T any](a, b Tuple[T]) Tuple[T]

Concat concats two tuple to one

func Make

func Make[T any](x ...T) Tuple[T]

Make create a tuple by parameters

func Slice

func Slice[T any](t Tuple[T], i, j int) Tuple[T]

Slice slice the tuple by range [i, j)

func T1

func T1[T any](a T) Tuple[T]

func T2

func T2[T any](a, b T) Tuple[T]

func T3

func T3[T any](a, b, c T) Tuple[T]

func T4

func T4[T any](a, b, c, d T) Tuple[T]

func T5

func T5[T any](a, b, c, d, e T) Tuple[T]

func T6

func T6[T any](a, b, c, d, e, f T) Tuple[T]

func T7

func T7[T any](a, b, c, d, e, f, g T) Tuple[T]

func T8

func T8[T any](a, b, c, d, e, f, g, h T) Tuple[T]

func T9

func T9[T any](a, b, c, d, e, f, g, h, i T) Tuple[T]

Jump to

Keyboard shortcuts

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