Documentation
¶
Index ¶
- func Concat[T any](xs []T, ys []T) []T
- func ConcatMap[T any, U any](xs []T, f func(T) []U) []U
- func Count[T any](xs []T, f func(T, int) bool) int
- func Each[T any](xs []T, f func(T, int))
- func Every[T any](xs []T, f func(T, int) bool) bool
- func Filter[T any](xs []T, f func(T, int) bool) []T
- func Find[T any](xs []T, f func(T) bool) (T, bool)
- func FindIndex[T any](xs []T, f func(T) bool) int
- func FindLast[T any](xs []T, f func(T) bool) (T, bool)
- func FindLastIndex[T any](xs []T, f func(T) bool) int
- func Map[T any, U any](xs []T, f func(T, int) U) []U
- func None[T any](xs []T, f func(T, int) bool) bool
- func Reduce[T any](xs []T, f func(T, T, int) T, initial T) T
- func Reverse[T any](xs []T) []T
- func Some[T any](xs []T, f func(T, int) bool) bool
- func Uniq[T comparable](xs []T) []T
- func UniqBy[T any, U comparable](xs []T, f func(T) U) []T
- type MapCollection
- func (mc *MapCollection[K, V]) All() map[K]V
- func (mc *MapCollection[K, V]) At(i K) V
- func (mc *MapCollection[K, V]) Each(f func(V, K)) *MapCollection[K, V]
- func (mc *MapCollection[K, V]) Filter(f func(V, K) bool) *MapCollection[K, V]
- func (mc *MapCollection[K, V]) Find(f func(V) bool) (V, error)
- func (mc *MapCollection[K, V]) Get() map[K]V
- func (mc *MapCollection[K, V]) Items() map[K]V
- func (mc *MapCollection[K, V]) Keys() *SliceCollection[K]
- func (mc *MapCollection[K, V]) Len() int
- func (mc *MapCollection[K, V]) Map(f func(V, K) V) *MapCollection[K, V]
- func (mc *MapCollection[K, V]) Reduce(f func(V, V, K) V, initial V) V
- func (mc *MapCollection[K, V]) Values() *SliceCollection[V]
- type SliceCollection
- func (sc *SliceCollection[T]) All() []T
- func (sc *SliceCollection[T]) At(i int) T
- func (sc *SliceCollection[T]) Each(f func(T, int)) *SliceCollection[T]
- func (sc *SliceCollection[T]) Filter(f func(T, int) bool) *SliceCollection[T]
- func (sc *SliceCollection[T]) Find(f func(T) bool) (T, error)
- func (sc *SliceCollection[T]) FindIndex(f func(T) bool) int
- func (sc *SliceCollection[T]) FindLast(f func(T) bool) (T, bool)
- func (sc *SliceCollection[T]) FindLastIndex(f func(T) bool) int
- func (sc *SliceCollection[T]) Get() []T
- func (sc *SliceCollection[T]) Items() []T
- func (sc *SliceCollection[T]) Len() int
- func (sc *SliceCollection[T]) Map(f func(T, int) T) *SliceCollection[T]
- func (sc *SliceCollection[T]) Reduce(f func(T, T, int) T, initial T) T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindLastIndex ¶
func Uniq ¶
func Uniq[T comparable](xs []T) []T
func UniqBy ¶
func UniqBy[T any, U comparable](xs []T, f func(T) U) []T
Types ¶
type MapCollection ¶
type MapCollection[K comparable, V any] struct { // contains filtered or unexported fields }
func NewMap ¶
func NewMap[K comparable, V any](xs map[K]V) *MapCollection[K, V]
func (*MapCollection[K, V]) All ¶
func (mc *MapCollection[K, V]) All() map[K]V
func (*MapCollection[K, V]) At ¶
func (mc *MapCollection[K, V]) At(i K) V
func (*MapCollection[K, V]) Each ¶
func (mc *MapCollection[K, V]) Each(f func(V, K)) *MapCollection[K, V]
func (*MapCollection[K, V]) Filter ¶
func (mc *MapCollection[K, V]) Filter(f func(V, K) bool) *MapCollection[K, V]
func (*MapCollection[K, V]) Find ¶
func (mc *MapCollection[K, V]) Find(f func(V) bool) (V, error)
func (*MapCollection[K, V]) Get ¶
func (mc *MapCollection[K, V]) Get() map[K]V
func (*MapCollection[K, V]) Items ¶
func (mc *MapCollection[K, V]) Items() map[K]V
func (*MapCollection[K, V]) Keys ¶
func (mc *MapCollection[K, V]) Keys() *SliceCollection[K]
func (*MapCollection[K, V]) Len ¶
func (mc *MapCollection[K, V]) Len() int
func (*MapCollection[K, V]) Map ¶
func (mc *MapCollection[K, V]) Map(f func(V, K) V) *MapCollection[K, V]
func (*MapCollection[K, V]) Reduce ¶
func (mc *MapCollection[K, V]) Reduce(f func(V, V, K) V, initial V) V
func (*MapCollection[K, V]) Values ¶
func (mc *MapCollection[K, V]) Values() *SliceCollection[V]
type SliceCollection ¶
type SliceCollection[T any] struct { // contains filtered or unexported fields }
func NewSlice ¶
func NewSlice[T any](xs []T) *SliceCollection[T]
func (*SliceCollection[T]) All ¶
func (sc *SliceCollection[T]) All() []T
func (*SliceCollection[T]) At ¶
func (sc *SliceCollection[T]) At(i int) T
func (*SliceCollection[T]) Each ¶
func (sc *SliceCollection[T]) Each(f func(T, int)) *SliceCollection[T]
func (*SliceCollection[T]) Filter ¶
func (sc *SliceCollection[T]) Filter(f func(T, int) bool) *SliceCollection[T]
func (*SliceCollection[T]) Find ¶
func (sc *SliceCollection[T]) Find(f func(T) bool) (T, error)
func (*SliceCollection[T]) FindIndex ¶
func (sc *SliceCollection[T]) FindIndex(f func(T) bool) int
func (*SliceCollection[T]) FindLast ¶
func (sc *SliceCollection[T]) FindLast(f func(T) bool) (T, bool)
func (*SliceCollection[T]) FindLastIndex ¶
func (sc *SliceCollection[T]) FindLastIndex(f func(T) bool) int
func (*SliceCollection[T]) Get ¶
func (sc *SliceCollection[T]) Get() []T
func (*SliceCollection[T]) Items ¶
func (sc *SliceCollection[T]) Items() []T
func (*SliceCollection[T]) Len ¶
func (sc *SliceCollection[T]) Len() int
func (*SliceCollection[T]) Map ¶
func (sc *SliceCollection[T]) Map(f func(T, int) T) *SliceCollection[T]
func (*SliceCollection[T]) Reduce ¶
func (sc *SliceCollection[T]) Reduce(f func(T, T, int) T, initial T) T
Click to show internal directories.
Click to hide internal directories.