Documentation ¶
Index ¶
- func All[I ~[]T, T any](input I, condition func(t T) bool) (output []T)
- func First[I ~[]T, T any](input I, condition func(t T) bool) *T
- func From[I ~[]T, T, R any](input I, mapper func(t T) R) (output []R)
- func FromMap[M ~map[K1]V1, K1, K2 comparable, V1, V2 any](input M, mapper func(K1, V1) (K2, V2, bool)) (output map[K2]V2)
- func In[E comparable](values ...E) (condition func(item E) bool)
- func Last[I ~[]T, T any](input I, condition func(t T) bool) *T
- func Not[T any, C func(t T) bool](condition C) C
- func With[C ~func(t T) bool, T any](conditions ...C) (condition C)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func All ¶
All collects all items from input that satisfy the condition Empty or nil input returns nil output
func First ¶
First collects the first item from input that satisfies the condition Empty or nil input returns nil output
func From ¶
func From[I ~[]T, T, R any](input I, mapper func(t T) R) (output []R)
From translates a slice into another using a mapper func (T) => (R). Empty or nil input returns nil output
func FromMap ¶
func FromMap[M ~map[K1]V1, K1, K2 comparable, V1, V2 any](input M, mapper func(K1, V1) (K2, V2, bool)) (output map[K2]V2)
FromMap translates a map into another using a mapper func (k1, v2) => (k2, v2, include). Empty or nil input returns nil output
func In ¶
func In[E comparable](values ...E) (condition func(item E) bool)
In returns a new condition that is true as one of the values matches
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.