pipies

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 IsNil

func IsNil[T any](x *T) bool

IsNil returns true if x underlying value is nil.

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

func Not[T any](fn func(x T) bool) func(T) bool

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

func NotNil[T any](x *T) bool

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

func Nott[T1, T2 any](fn func(x T1, y T2) bool) func(T1, T2) bool

Nott returns a new function that negates the result of the input function.

func Nottt added in v1.0.2

func Nottt[T1, T2, T3 any](fn func(x T1, y T2, z T3) bool) func(T1, T2, T3) bool

Nottt returns a new function that negates the result of the input function.

func Sum

func Sum[T cns.Float | cns.Integer | cns.Complex](a, b *T) T

Sum is a reduce function for summing up types that support "+".

Types

This section is empty.

Jump to

Keyboard shortcuts

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