Documentation ¶
Overview ¶
Function set to use with Sort
Function set to use with Filter ¶
Function set to use with Reduce
Index ¶
- func Distinct[T any, C comparable](getKey func(x *T) C) pipe.Predicate[T]
- func Eq[T comparable](x T) pipe.Predicate[T]
- func IsNil[T any](x *T) bool
- func Less[T constraints.Ordered](x, y *T) bool
- func LessThan[T constraints.Ordered](x T) pipe.Predicate[T]
- func Not[T any](fn func(x T) bool) func(T) bool
- func NotEq[T comparable](x T) pipe.Predicate[T]
- func NotNil[T any](x *T) bool
- func NotZero[T comparable](x *T) bool
- func Nott[T1, T2 any](fn func(x T1, y T2) bool) func(T1, T2) bool
- func Nottt[T1, T2, T3 any](fn func(x T1, y T2, z T3) bool) func(T1, T2, T3) bool
- func Sum[T cns.Float | cns.Integer | cns.Complex | ~string](a, b *T) T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Distinct ¶ added in v1.0.5
func Distinct[T any, C comparable](getKey func(x *T) C) pipe.Predicate[T]
Distinct returns a predicate with filters out the same elements compated by the output of getKey function. getKey function should receive an argument of a Pipe value type. The result function is rather slow since it takes a lock on each element. You should use Pipe.Distinct() to get better performance.
func Eq ¶
func Eq[T comparable](x T) pipe.Predicate[T]
Eq returns a predicate which is true when the argument is equal to x.
func Less ¶
func Less[T constraints.Ordered](x, y *T) bool
Less returns true if x < y, false otherwise.
func LessThan ¶
func LessThan[T constraints.Ordered](x T) pipe.Predicate[T]
LessThan returns a predicate which is true when the argument is less than x.
func Not ¶ added in v1.0.2
Not returns a new function that negates the result of the input function.
func NotEq ¶
func NotEq[T comparable](x T) pipe.Predicate[T]
NotEq returns a predicate which is true when the argument is NOT equal to x.
func NotNil ¶
NotNil returns true is x underlying value is not nil. It uses reflection, so if you don't store any pointers, better use NotZero.
func NotZero ¶
func NotZero[T comparable](x *T) bool
NotZero returns true is x equals to a default zero value of the type T.
func Nott ¶ added in v1.0.2
Nott returns a new function that negates the result of the input function.
Types ¶
This section is empty.