lists

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Collect

func Collect[E any, O any](arr []E, f func(E) O) []O

func Collects

func Collects[E any, O any](arr []E, f func(E) []O) []O

func Filter

func Filter[E any](arr []E, filter func(e E) bool) (List[E], List[E])

func FirstOrDefault

func FirstOrDefault[T any](a []T, d *T) *T

func For

func For[K any, V any](arr *[]K, m func(K) V) *[]V

func ForArray

func ForArray[K any, V any](arr *List[K], m func(K) V) *[]V

func ForEach

func ForEach[K interface{}](arr *[]*K, act func(*K))

func ForFlatten

func ForFlatten[E any](arr *[]E, f func(E) []E) *[]E

func Join

func Join[E any](arr *[]E, separator string, f func(E) string) *string

func Of

func Of[T any](a ...T) *[]T

func Process

func Process[K any](arr *[]K, actors ...func(K) error) error

func VaJoin

func VaJoin(separator string, arr ...string) *string

func VaJoinFn

func VaJoinFn[E any](separator string, f func(E) string, arr ...E) *string

Types

type List

type List[T any] []T

func (*List[T]) Add

func (l *List[T]) Add(a ...T) *List[T]

func (*List[T]) Delete

func (l *List[T]) Delete(a ...int) *List[T]

func (*List[T]) Empty

func (l *List[T]) Empty() bool

func (*List[T]) FirstOrDefault

func (l *List[T]) FirstOrDefault(d *T) *T

func (*List[T]) For

func (l *List[T]) For(fn func(t T))

func (*List[T]) ForRest

func (l *List[T]) ForRest(n int, fn func(t T), rest func(t T))

func (*List[T]) Last

func (l *List[T]) Last() T

func (*List[T]) Length

func (l *List[T]) Length() int

func (*List[T]) Sub

func (l *List[T]) Sub(start, stop int) List[T]

Jump to

Keyboard shortcuts

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