funcy

package
v0.0.0-...-56ccd80 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: Unlicense Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains[T comparable](xs []T, v T) bool

Contains checks a list contains an item.

func EMap

func EMap[T1, T2 any](xs []T1, fn func(x T1, err error) (T2, error)) ([]T2, error)

EMap does a functional map, but passes any error into the next map call. The final error is returned.

func Filter

func Filter[T any](xs []T, f func(x T) bool) []T

Filter removes any values for which f evaluates true.

func Map

func Map[T1, T2 any](xs []T1, fn func(x T1) T2) []T2

Map does a functional map operation

func Reduce

func Reduce[T, M any](s []T, f func(M, T) M, init M) M

Reduce converts a slice of T to M.

Types

This section is empty.

Jump to

Keyboard shortcuts

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