mr

package
v0.0.0-...-6797358 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All(arr []bool) bool

Any Returns true if all values are true

func Any

func Any(arr []bool) bool

Any Returns true if arr contain any true value

func Filter

func Filter[T any](arr []T, fn func(i int, v T) bool) []T

func GroupBy

func GroupBy[T any, E atoms.Basic](arr []T, by func(v T) E) map[E][]T

func GroupByOne

func GroupByOne[T any, E atoms.Basic](arr []T, keepFirst bool, by func(v T) E) map[E]T

func IndexOf

func IndexOf[T any](arr []T, fn func(v T) bool) int

func Map

func Map[T any](arr []T, fn func(i int, v T) T) []T

func MapTo

func MapTo[T any, E any](arr []T, fn func(i int, v T) E) []E

func Reduce

func Reduce[T any, E atoms.Basic](arr []T, initValue E, fn func(i int, v T, cum E) E) E

func Reindex

func Reindex[T any](arr []T, indexes []int)

Reindex 按indexes设置索引

func ValueIndex

func ValueIndex[T atoms.Basic](arr []T) map[T]int

ValueIndex arr -> [value]index

Types

This section is empty.

Jump to

Keyboard shortcuts

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