highorder

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Filter

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

Filter filters elements from the input slice based on the given predicate function. It returns a new slice containing only elements that satisfy the predicate.

func Map

func Map[T, U any](input []T, fn func(T) U) []U

Map applies a transformation function to each element in the input slice. It returns a new slice containing the transformed elements.

func Reduce

func Reduce[T, U any](input []T, acc U, accfn func(T, U) U) U

Reduce applies an accumulator function to each element of the input slice, carrying forward the accumulated result. It returns the final accumulated value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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