slicefn

package
v0.0.0-...-93e11d5 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

View Source
const ErrNotFound = merr.Code("not_found")

Variables

This section is empty.

Functions

func Every

func Every[T any](slice []T, fn func(T) bool) bool

func EveryE

func EveryE[T any](slice []T, fn func(T) (bool, error)) (bool, error)

func Filter

func Filter[T any](slice []T, fn func(T) bool) []T

func FilterE

func FilterE[T any](slice []T, fn func(T) (bool, error)) (res []T, err error)

func Find

func Find[T any](slice []T, fn func(T) bool) (res T, ok bool)

func FindE

func FindE[T any](slice []T, fn func(T) (bool, error)) (res T, ok bool, err error)

func FindIndex

func FindIndex[T any](slice []T, fn func(T) bool) int

func FindIndexE

func FindIndexE[T any](slice []T, fn func(T) (bool, error)) (int, error)

func FindLast

func FindLast[T any](slice []T, fn func(T) bool) (res T, ok bool)

func FindLastE

func FindLastE[T any](slice []T, fn func(T) (bool, error)) (res T, ok bool, err error)

func FindLastIndex

func FindLastIndex[T any](slice []T, fn func(T) bool) int

func FindLastIndexE

func FindLastIndexE[T any](slice []T, fn func(T) (bool, error)) (int, error)

func FindLastPtr

func FindLastPtr[T any](slice []T, fn func(T) bool) *T

func FindLastPtrE

func FindLastPtrE[T any](slice []T, fn func(T) (bool, error)) (*T, error)

func FindPtr

func FindPtr[T any](slice []T, fn func(T) bool) *T

func FindPtrE

func FindPtrE[T any](slice []T, fn func(T) (bool, error)) (*T, error)

func Map

func Map[T1, T2 any](slice []T1, fn func(T1) T2) []T2

func MapE

func MapE[T1, T2 any](slice []T1, fn func(T1) (T2, error)) (res []T2, err error)

func Reduce

func Reduce[T1, T2 any](slice []T1, fn func(acc T2, item T1) T2, initial T2) T2

func ReduceE

func ReduceE[T1, T2 any](slice []T1, fn func(acc T2, item T1) (T2, error), initial T2) (acc T2, err error)

func Some

func Some[T any](slice []T, fn func(T) bool) bool

func SomeE

func SomeE[T any](slice []T, fn func(T) (bool, error)) (bool, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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