Documentation
¶
Index ¶
- func Accum_all[T any, Q any](s []T, init Q, f func(T, Q) Q) Q
- func Filter[T any, Q any](s []T, f func(T) Q) []Q
- func Filter_M[K comparable, T any, Q any](s map[K]T, f func(T) Q) map[K]Q
- func Filter_MtS[K comparable, T any, Q any](s map[K]T, f func(T) Q) []Q
- func Filter_MtS_ok[K comparable, T any, Q any](s map[K]T, f func(T) (Q, bool)) []Q
- func Filter_ok[T any, Q any](s []T, f func(T) (Q, bool)) []Q
- func Filter_strict_ok[T any, Q any](s []T, f func(T) (Q, bool)) ([]Q, bool)
- func Filter_until_err[T any, Q any](s []T, f func(T) (Q, error)) ([]Q, []T, error)
- func Foreach[T any](s []T, f func(T))
- func FuncReducePostfix[A1, A2, R any](f func(A1, A2) R, a2 A2) func(A1) R
- func FuncReducePrefix[A1, A2, R any](a1 A1, f func(A1, A2) R) func(A2) R
- type Maybe
- type MaybeErr
- type Quadruple
- type Triple
- type Tuple
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Filter_M ¶ added in v0.1.202602121754
func Filter_M[K comparable, T any, Q any](s map[K]T, f func(T) Q) map[K]Q
Filter_MtS equlivalents to Filter, but takes and returns map.
func Filter_MtS ¶ added in v0.1.202602121754
func Filter_MtS[K comparable, T any, Q any](s map[K]T, f func(T) Q) []Q
Filter_MtS equlivalents to Filter, but takes map and returns slice.
func Filter_MtS_ok ¶ added in v0.1.202602121754
func Filter_MtS_ok[K comparable, T any, Q any](s map[K]T, f func(T) (Q, bool)) []Q
Filter_MtS_ok equlivalents to Filter_ok, but takes map and returns slice.
func Filter_ok ¶
Filter_ok takes an array and a function that returns (result, ok). The result values with ok == true is concatenated and returned.
func Filter_until_err ¶
Filter_until_err takes an array and a function that returns a result and an error, tries to filter all entries, but stops if one call returns error. Returns result, remnant (nil if success), error When fails, the first entry of the remnant is the one which caused the error.
func FuncReducePostfix ¶
func FuncReducePostfix[A1, A2, R any](f func(A1, A2) R, a2 A2) func(A1) R
func FuncReducePrefix ¶
func FuncReducePrefix[A1, A2, R any](a1 A1, f func(A1, A2) R) func(A2) R
Types ¶
type Maybe ¶
type Maybe[T any] struct { Value T // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.