functions

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorFunc

type ErrorFunc func(error)

ErrorFunc is a function that takes an error and returns nothing. The pippin use-case for it is to perform some action on the error in the form of a side effect, for example, logging.

If you need to return a value on error, use ErrorMapFunc.

type ErrorMapFunc

type ErrorMapFunc[Out any] func(error) Out

ErrorMapFunc is a function that takes an error and returns an output. The pippin use-case for it is to perform some action on the error and return an output. For example, provide a default value.

If you don't need to return a value on error, use ErrorFunc.

type FilterFunc

type FilterFunc[In any] func(In) bool

FilterFunc is a function that takes an input and returns a boolean. The pippin use-case for it is to filter out the objects of one type.

type ForEachFunc

type ForEachFunc[In any] func(In)

ForEachFunc is a function that takes an input and returns nothing. The pippin use-case for it is to perform some action on the object of one type in the form of a side effect.

type MapFunc

type MapFunc[In, Out any] func(In) Out

MapFunc is a function that takes an input and returns an output. The pippin use-case for it is to transform the object of one type into another type.

type MapWithErrFunc

type MapWithErrFunc[In, Out any] func(In) (Out, error)

MapWithErrFunc is a function that takes an input and returns an output and an error. The pippin use-case for it is to transform the object of one type into another type and return an error if any.

type ReduceFunc

type ReduceFunc[In any] func(In, In) In

ReduceFunc is a function that takes two inputs and returns one output. The pippin use-case for it is to aggregate the objects of one type into the object of the same type with accumulated values.

Jump to

Keyboard shortcuts

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