function

package
v0.0.0-...-11759f2 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Max

func Max[T constraints.Ordered](i, j T) T

func Min

func Min[T constraints.Ordered](i, j T) T

func Sum

func Sum[T constraints.Ordered](i, j T) T

Types

type BiFunc

type BiFunc[T, U, R any] func(T, U) R

func AndBiThen

func AndBiThen[T, U, R, V any](source BiFunc[T, U, R], after Func[R, V]) BiFunc[T, U, V]

func (BiFunc[T, U, R]) Apply

func (fn BiFunc[T, U, R]) Apply(t T, u U) R

type BiPredicate

type BiPredicate[T, U any] func(t T, u U) bool

func (BiPredicate[T, U]) And

func (fn BiPredicate[T, U]) And(other BiPredicate[T, U]) BiPredicate[T, U]

func (BiPredicate[T, U]) Negate

func (fn BiPredicate[T, U]) Negate() BiPredicate[T, U]

func (BiPredicate[T, U]) Or

func (fn BiPredicate[T, U]) Or(other BiPredicate[T, U]) BiPredicate[T, U]

func (BiPredicate[T, U]) Test

func (fn BiPredicate[T, U]) Test(t T, u U) bool

type Consumer

type Consumer[T any] func(t T)

func (Consumer[T]) Accept

func (fn Consumer[T]) Accept(t T)

func (Consumer[T]) AndThen

func (fn Consumer[T]) AndThen(after Consumer[T]) Consumer[T]

type Func

type Func[T, R any] func(T) R

func AndThen

func AndThen[T, R, V any](source Func[T, R], after Func[R, V]) Func[T, V]

func Compose

func Compose[T, R, V any](source Func[T, R], before Func[V, T]) Func[V, R]

func (Func[T, R]) Apply

func (fn Func[T, R]) Apply(t T) R

func (Func[T, R]) Identify

func (Func[T, R]) Identify() Func[T, T]

type Predicate

type Predicate[T any] func(t T) bool

func (Predicate[T]) And

func (fn Predicate[T]) And(other Predicate[T]) Predicate[T]

func (Predicate[T]) DeepEqual

func (fn Predicate[T]) DeepEqual(obj any) Predicate[T]

DeepEqual is a function that takes an object of any type and returns a Predicate[T] which checks if the given object is deeply equal to the argument passed in by reflect.DeepEqual.

func (Predicate[T]) Negate

func (fn Predicate[T]) Negate() Predicate[T]

func (Predicate[T]) Not

func (fn Predicate[T]) Not(other Predicate[T]) Predicate[T]

func (Predicate[T]) Or

func (fn Predicate[T]) Or(other Predicate[T]) Predicate[T]

func (Predicate[T]) Test

func (fn Predicate[T]) Test(t T) bool

type Runner

type Runner func()

func (Runner) AndThen

func (fn Runner) AndThen(after Runner) Runner

func (Runner) Run

func (fn Runner) Run()

type Supplier

type Supplier[T any] func() T

func (Supplier[T]) Get

func (fn Supplier[T]) Get() T

Jump to

Keyboard shortcuts

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