generic

package
v1.0.49 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheCallback

func CacheCallback[F ~func(A) T, KF func(A) K, C ~func(K, func() func() T) func() T, A any, K comparable, T any](kf KF, getOrCreate C) func(F) F

CacheCallback converts a unary function into a unary function that caches the value depending on the parameter

func ContramapMemoize added in v1.0.27

func ContramapMemoize[F ~func(A) T, KF func(A) K, A any, K comparable, T any](kf KF) func(F) F

ContramapMemoize converts a unary function into a unary function that caches the value depending on the parameter

func Memoize added in v1.0.27

func Memoize[F ~func(K) T, K comparable, T any](f F) F

Memoize converts a unary function into a unary function that caches the value depending on the parameter

Types

This section is empty.

Jump to

Keyboard shortcuts

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