functional

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Keys

func Keys[M ~map[K]V, K comparable, V any](m M) []K

Keys 快捷提取所有key,不用写闭包

func Map

func Map[T, R any](src []T, fn func(T) R) []R

Map 处理切片 []T,单参数转换

func MapEntries

func MapEntries[M ~map[K]V, K comparable, V any, R any](m M, fn func(K, V) R) []R

MapEntries 遍历完整键值对 k+v

func MapKeys

func MapKeys[M ~map[K]V, K comparable, V any, R any](m M, fn func(K) R) []R

MapKeys 只遍历map key,对key做映射

func Reduce

func Reduce[T, R any](src []T, init R, fn func(R, T) R) R

Types

This section is empty.

Jump to

Keyboard shortcuts

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