Documentation ¶
Index ¶
- func All[T any](s []T, fn func(T) bool) bool
- func Any[T any](s []T, fn func(T) bool) bool
- func Apply[T any](fn func(t T), s []T)
- func AsAny[T any](s []T) []any
- func Cast[T, R any](s []T) []R
- func Clone[T any](s []T) []T
- func Contains[T comparable](s []T, v T) bool
- func Count[T comparable](s []T, v T) int
- func CountFunc[T comparable](s []T, fn func(T) bool) int
- func DeepFlatten[T any](vs ...any) []T
- func DeleteAt[T any](s []T, i int) []T
- func Dup2[T any](v T) (T, T)
- func Dup3[T any](v T) (T, T, T)
- func Dup4[T any](v T) (T, T, T, T)
- func Equal[T comparable](l, r []T) bool
- func Filter[T any](fn func(t T) bool, s []T) []T
- func Find[T comparable](s []T, v T) (int, bool)
- func FindElemFunc[T any](s []T, fn func(T) bool) (T, bool)
- func FindFunc[T any](s []T, fn func(T) bool) (int, bool)
- func FindFuncLast[T any](s []T, fn func(T) bool) (int, bool)
- func FindLast[T comparable](s []T, v T) (int, bool)
- func FlatMap[T, R any](fn func(t T) []R, s []T) []R
- func Flatten[T any](s [][]T) []T
- func Get[T any](s []T, i int) T
- func IndexMap[T, R any](fn func(i int, t T) R, s []T) []R
- func Interleave[T any](s []T, e T) []T
- func Join[T any](ss ...[]T) []T
- func KvsOf[K, V any](o ...any) []bt.Kv[K, V]
- func MakeAppend[T any](s []T, a ...T) []T
- func MakePrepend[T any](s []T, a ...T) []T
- func Map[T, R any](fn func(t T) R, s []T) []R
- func Partition[T any](fn func(t T) bool, s []T) (t []T, f []T)
- func Pop[T any](s *[]T) T
- func PtrTo[T any](s []T, i int) *T
- func PtrUnpack1[T any](s []T) *T
- func PtrUnpack2[T any](s []T) (*T, *T)
- func PtrUnpack3[T any](s []T) (*T, *T, *T)
- func PtrUnpack4[T any](s []T) (*T, *T, *T, *T)
- func Reduce[T any](fn func(l, r T) T, d T, s []T) T
- func Repeat[T any](s []T, n int) []T
- func Reshape[T any](s []T, start, stop, step int) []T
- func Reverse[T any](s []T) []T
- func Reversed[T any](s []T) []T
- func Set[T any](s []T, i int, t T)
- func ShiftAs[E any](s *[]any) (E, bool)
- func Sort[T constraints.Ordered](s []T) []T
- func Sorted[T constraints.Ordered](s []T) []T
- func TryShiftAs[E any](s *[]any) E
- func Unpack1[T any](s []T) T
- func Unpack2[T any](s []T) (T, T)
- func Unpack3[T any](s []T) (T, T, T)
- func Unpack4[T any](s []T) (T, T, T, T)
- func ZipMap2[T, U, R any](fn func(t T, u U) R, ts []T, us []U) []R
- func ZipMap3[T, U, V, R any](fn func(t T, u U, v V) R, ts []T, us []U, vs []V) []R
- type PqInitItem
- type PqItem
- type PriorityQueue
- func (pq *PriorityQueue[T]) At(index int) *PqItem[T]
- func (pq *PriorityQueue[T]) Init(items []PqInitItem[T])
- func (pq *PriorityQueue[T]) Len() int
- func (pq *PriorityQueue[T]) Pop() PqItem[T]
- func (pq *PriorityQueue[T]) Push(value T, priority float32)
- func (pq *PriorityQueue[T]) UpdatePriority(item *PqItem[T], priority float32)
- type PtrPriorityQueue
- func (pq *PtrPriorityQueue[T]) At(index int) *PqItem[T]
- func (pq *PtrPriorityQueue[T]) Init(items []PqInitItem[T])
- func (pq *PtrPriorityQueue[T]) Len() int
- func (pq *PtrPriorityQueue[T]) Pop() PqItem[T]
- func (pq *PtrPriorityQueue[T]) Push(value T, priority float32)
- func (pq *PtrPriorityQueue[T]) UpdatePriority(item *PqItem[T], priority float32)
- type SliceLengthError
- type Stack
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
func Contains[T comparable](s []T, v T) bool
func Count ¶
func Count[T comparable](s []T, v T) int
func CountFunc ¶
func CountFunc[T comparable](s []T, fn func(T) bool) int
func DeepFlatten ¶
func Equal ¶
func Equal[T comparable](l, r []T) bool
func Find ¶
func Find[T comparable](s []T, v T) (int, bool)
func FindElemFunc ¶
func FindLast ¶
func FindLast[T comparable](s []T, v T) (int, bool)
func Interleave ¶
func Interleave[T any](s []T, e T) []T
func MakeAppend ¶
func MakeAppend[T any](s []T, a ...T) []T
func MakePrepend ¶
func MakePrepend[T any](s []T, a ...T) []T
func PtrUnpack1 ¶
func PtrUnpack1[T any](s []T) *T
func PtrUnpack2 ¶
func PtrUnpack2[T any](s []T) (*T, *T)
func PtrUnpack3 ¶
func PtrUnpack3[T any](s []T) (*T, *T, *T)
func PtrUnpack4 ¶
func PtrUnpack4[T any](s []T) (*T, *T, *T, *T)
func Sort ¶
func Sort[T constraints.Ordered](s []T) []T
func Sorted ¶
func Sorted[T constraints.Ordered](s []T) []T
func TryShiftAs ¶
Types ¶
type PqInitItem ¶
type PriorityQueue ¶
type PriorityQueue[T any] struct { // contains filtered or unexported fields }
func (*PriorityQueue[T]) At ¶
func (pq *PriorityQueue[T]) At(index int) *PqItem[T]
func (*PriorityQueue[T]) Init ¶
func (pq *PriorityQueue[T]) Init(items []PqInitItem[T])
func (*PriorityQueue[T]) Len ¶
func (pq *PriorityQueue[T]) Len() int
func (*PriorityQueue[T]) Pop ¶
func (pq *PriorityQueue[T]) Pop() PqItem[T]
func (*PriorityQueue[T]) Push ¶
func (pq *PriorityQueue[T]) Push(value T, priority float32)
func (*PriorityQueue[T]) UpdatePriority ¶
func (pq *PriorityQueue[T]) UpdatePriority(item *PqItem[T], priority float32)
type PtrPriorityQueue ¶
type PtrPriorityQueue[T any] struct { // contains filtered or unexported fields }
func (*PtrPriorityQueue[T]) At ¶
func (pq *PtrPriorityQueue[T]) At(index int) *PqItem[T]
func (*PtrPriorityQueue[T]) Init ¶
func (pq *PtrPriorityQueue[T]) Init(items []PqInitItem[T])
func (*PtrPriorityQueue[T]) Len ¶
func (pq *PtrPriorityQueue[T]) Len() int
func (*PtrPriorityQueue[T]) Pop ¶
func (pq *PtrPriorityQueue[T]) Pop() PqItem[T]
func (*PtrPriorityQueue[T]) Push ¶
func (pq *PtrPriorityQueue[T]) Push(value T, priority float32)
func (*PtrPriorityQueue[T]) UpdatePriority ¶
func (pq *PtrPriorityQueue[T]) UpdatePriority(item *PqItem[T], priority float32)
type SliceLengthError ¶
type SliceLengthError struct {
Actual, Expected int
}
func (SliceLengthError) Error ¶
func (e SliceLengthError) Error() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.