funcx

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Must

func Must[T any](fn func() (T, error)) T

Must returns fn()'s first return if error is nil, otherwise panics with error.

func Partial1

func Partial1[P any, R any](fn func(P) R, p P) func() R

Partial1 will apply 1 param to the passed function (first parameter). The function returns another function which can be called with the rest of the parameters.

func Partial1E

func Partial1E[P any, R any](fn func(P) (R, error), p P) func() (R, error)

Partial1E will apply 1 param to the passed function (first parameter). The function returns another function which can be called with the rest of the parameters.

func Partial1Of2

func Partial1Of2[P1 any, P2 any, R any](fn func(P1, P2) R, p1 P1) func(P2) R

Partial1Of2 will apply 1 param from head to the passed function. The function returns another function which can be called with the rest of the parameters.

func Partial1Of2E

func Partial1Of2E[P1 any, P2 any, R any](fn func(P1, P2) (R, error), p1 P1) func(P2) (R, error)

Partial1Of2E will apply 1 param from head to the passed function. The function returns another function which can be called with the rest of the parameters.

func Partial1Of2FromTail

func Partial1Of2FromTail[P1 any, P2 any, R any](fn func(P1, P2) R, p2 P2) func(P1) R

Partial1Of2FromTail will apply 1 param from tail to the passed function. The function returns another function which can be called with the rest of the parameters.

func Partial1Of2FromTailE

func Partial1Of2FromTailE[P1 any, P2 any, R any](fn func(P1, P2) (R, error), p2 P2) func(P1) (R, error)

Partial1Of2FromTailE will apply 1 param from tail to the passed function. The function returns another function which can be called with the rest of the parameters.

func Partial1Of3

func Partial1Of3[P1 any, P2 any, P3 any, R any](fn func(P1, P2, P3) R, p1 P1) func(P2, P3) R

Partial1Of3 will apply 1 param from head to the passed function. The function returns another function which can be called with the rest of the parameters.

func Partial1Of3E

func Partial1Of3E[P1 any, P2 any, P3 any, R any](fn func(P1, P2, P3) (R, error), p1 P1) func(P2, P3) (R, error)

Partial1Of3E will apply 1 param from head to the passed function. The function returns another function which can be called with the rest of the parameters.

func Partial1Of3FromTail

func Partial1Of3FromTail[P1 any, P2 any, P3 any, R any](fn func(P1, P2, P3) R, p3 P3) func(P1, P2) R

Partial1Of3FromTail will apply 1 param from tail to the passed function. The function returns another function which can be called with the rest of the parameters.

func Partial1Of3FromTailE

func Partial1Of3FromTailE[P1 any, P2 any, P3 any, R any](fn func(P1, P2, P3) (R, error), p3 P3) func(P1, P2) (R, error)

Partial1Of3FromTailE will apply 1 param from tail to the passed function. The function returns another function which can be called with the rest of the parameters.

func Partial2Of3

func Partial2Of3[P1 any, P2 any, P3 any, R any](fn func(P1, P2, P3) R, p1 P1, p2 P2) func(P3) R

Partial2Of3 will apply 2 param from head to the passed function. The function returns another function which can be called with the rest of the parameters.

func Partial2Of3E

func Partial2Of3E[P1 any, P2 any, P3 any, R any](fn func(P1, P2, P3) (R, error), p1 P1, p2 P2) func(P3) (R, error)

Partial2Of3E will apply 2 param from head to the passed function. The function returns another function which can be called with the rest of the parameters.

func Partial2Of3FromTail

func Partial2Of3FromTail[P1 any, P2 any, P3 any, R any](fn func(P1, P2, P3) R, p2 P2, p3 P3) func(P1) R

Partial2Of3FromTail will apply 2 param from tail to the passed function. The function returns another function which can be called with the rest of the parameters.

func Partial2Of3FromTailE

func Partial2Of3FromTailE[P1 any, P2 any, P3 any, R any](fn func(P1, P2, P3) (R, error), p2 P2, p3 P3) func(P1) (R, error)

Partial2Of3FromTailE will apply 2 param from tail to the passed function. The function returns another function which can be called with the rest of the parameters.

Types

This section is empty.

Jump to

Keyboard shortcuts

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