slicex

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equivalent added in v0.2.1

func Equivalent[T comparable, E ~[]T](x, y E) bool

Equivalent compares two slices has same elements without order

func Filter added in v0.4.9

func Filter[E any, S ~[]E](s S, filter func(E) bool) S

Filter filters s with filter function

func FilterMapping added in v0.4.8

func FilterMapping[E any, T any, S ~[]E](s S, m func(E) (T, bool)) []T

FilterMapping converts ~[]FROM to []TO by mapping function m, if m returns false the result will be filtered out

func M added in v0.3.0

func M[FROM any, TO any, E ~[]FROM](s E, m func(FROM) TO) []TO

M converts ~[]FROM to []TO by mapping function m Deprecated: use Mapping

func Map

func Map[E any, K comparable, V any, S ~[]E, R map[K]V](s S, m func(E) (K, V)) R

Map converts ~[]E to map[K]v by mapping function m

func Mapping added in v0.4.8

func Mapping[FROM any, TO any, E ~[]FROM](s E, m func(FROM) TO) []TO

Mapping converts ~[]FROM to []TO by mapping function m

func Unique added in v0.2.0

func Unique[T comparable, E ~[]T](s E) E

func UniqueKeys added in v0.2.11

func UniqueKeys[E any, S ~[]E, K comparable](s S, keyOfE func(E) K) []K

UniqueKeys collects partials P from slices S by func keyOfE

func UniqueValues added in v0.2.11

func UniqueValues[E any, S ~[]E, K comparable](s S, keyOfE func(E) K) []E

UniqueValues collects unique []E from slices S by func keyOfE

Types

This section is empty.

Jump to

Keyboard shortcuts

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