mirror of
https://github.com/IBM/fp-go.git
synced 2025-08-10 22:31:32 +02:00
fix: generic order on ContramapCache
Signed-off-by: Dr. Carsten Leue <carsten.leue@de.ibm.com>
This commit is contained in:
@@ -25,13 +25,13 @@ func Memoize[K comparable, T any](f func(K) T) func(K) T {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ContramapMemoize converts a unary function into a unary function that caches the value depending on the parameter
|
// ContramapMemoize converts a unary function into a unary function that caches the value depending on the parameter
|
||||||
func ContramapMemoize[A any, K comparable, T any](kf func(A) K) func(func(A) T) func(A) T {
|
func ContramapMemoize[T, A any, K comparable](kf func(A) K) func(func(A) T) func(A) T {
|
||||||
return G.ContramapMemoize[func(A) T](kf)
|
return G.ContramapMemoize[func(A) T](kf)
|
||||||
}
|
}
|
||||||
|
|
||||||
// CacheCallback converts a unary function into a unary function that caches the value depending on the parameter
|
// CacheCallback converts a unary function into a unary function that caches the value depending on the parameter
|
||||||
func CacheCallback[
|
func CacheCallback[
|
||||||
A any, K comparable, T any](kf func(A) K, getOrCreate func(K, func() func() T) func() T) func(func(A) T) func(A) T {
|
T, A any, K comparable](kf func(A) K, getOrCreate func(K, func() func() T) func() T) func(func(A) T) func(A) T {
|
||||||
return G.CacheCallback[func(func(A) T) func(A) T](kf, getOrCreate)
|
return G.CacheCallback[func(func(A) T) func(A) T](kf, getOrCreate)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
1337
tuple/gen.go
1337
tuple/gen.go
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user