Documentation ¶
Index ¶
- func Chunk[S ~[]E, E any](s S, size int) []S
- func Concat[S ~[]E, E any](ss ...S) S
- func ContainsFunc[E any](s []E, f func(E) bool) bool
- func Filter[S ~[]E, E any](s S, f func(int, E) bool) S
- func IsEmpty[S ~[]E, E any](s S) bool
- func IsNotEmpty[S ~[]E, E any](s S) bool
- func Map[S1 ~[]E1, S2 ~[]E2, E1 any, E2 any](s S1, f func(int, E1) E2) S2
- func NotContains[E comparable](s []E, v E) bool
- func NotContainsFunc[E any](s []E, f func(E) bool) bool
- func Reduce[S ~[]E, E any, R any](s S, initValue R, f func(R, int, E) R) R
- func Reverse[S ~[]E, E comparable](s S) S
- func ToMap[S ~[]E, M ~map[K]E, E any, K comparable](s S, f func(int, E) K) M
- func Uniq[S ~[]E, E comparable](s S) S
- type Stream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsFunc ¶ added in v1.0.9
ContainsFunc reports whether v is present in s.
func IsNotEmpty ¶ added in v1.0.6
func NotContains ¶ added in v1.0.12
func NotContains[E comparable](s []E, v E) bool
NotContains reports whether v is not present in s.
func NotContainsFunc ¶ added in v1.0.13
NotContainsFunc reports whether v is not present in s.
func Reverse ¶ added in v1.0.8
func Reverse[S ~[]E, E comparable](s S) S
func ToMap ¶ added in v1.0.3
func ToMap[S ~[]E, M ~map[K]E, E any, K comparable](s S, f func(int, E) K) M
ToMap 方法创建一个Map,这个Map由原数组中的每个元素都调用一次提供的函数后的返回值作为Key、每个元素作为Value组成。
func Uniq ¶ added in v1.0.7
func Uniq[S ~[]E, E comparable](s S) S
Types ¶
Click to show internal directories.
Click to hide internal directories.