lists

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddUnique

func AddUnique[T comparable](a []T, i T) []T

func Contains

func Contains[T comparable](a []T, i T) bool

func Copy

func Copy[T any](a []T) (out []T)

func Reverse

func Reverse[T any](a []T)

func Sort

func Sort[T any](a []T, less func(T, T) bool)

func SortFunc

func SortFunc[T any, S comparable](a []T, score func(T) S)

func SortWithSprint

func SortWithSprint[T any](a []T)

Types

type Set

type Set[T comparable] struct {
	// contains filtered or unexported fields
}

func (*Set[T]) Add

func (this *Set[T]) Add(t T) bool

func (*Set[T]) All

func (this *Set[T]) All() (list []T)

func (*Set[T]) Has

func (this *Set[T]) Has(t T) bool

func (*Set[T]) Remove

func (this *Set[T]) Remove(t T) bool

Jump to

Keyboard shortcuts

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