hof

package module
v0.0.0-...-a8a6657 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2024 License: MIT Imports: 1 Imported by: 0

README

High-Order Function (hof)

hof provides high-order function methods.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chunk

func Chunk[T any](src []T, size int) iter.Seq[[]T]

func Filter

func Filter[T any](src []T, fn func(T) bool) iter.Seq[T]

func Map

func Map[T, U any](src []T, fn func(T) U) iter.Seq[U]

func Map2

func Map2[T comparable, U any](src map[T]U, fn func(T, U) U) iter.Seq2[T, U]

func Reduce

func Reduce[T, U any](src []T, init U, fn func(U, T) U) iter.Seq[U]

func Reduce2

func Reduce2[K comparable, V, U any](src map[K]V, init U, fn func(U, K, V) U) iter.Seq[U]

Types

This section is empty.

Jump to

Keyboard shortcuts

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