1
0
mirror of https://github.com/IBM/fp-go.git synced 2025-08-10 22:31:32 +02:00

fix: add Zip and ZipWith to iterators

Signed-off-by: Dr. Carsten Leue <carsten.leue@de.ibm.com>
This commit is contained in:
Dr. Carsten Leue
2023-08-03 13:27:41 +02:00
parent 89265eed7c
commit e4fd34a6b5
27 changed files with 11663 additions and 11035 deletions

View File

@@ -34,3 +34,19 @@ func Add[T Number](left T) func(T) T {
func Inc[T Number](value T) T {
return value + 1
}
// Min takes the minimum of two values. If they are considered equal, the first argument is chosen
func Min[A C.Ordered](a, b A) A {
if a < b {
return a
}
return b
}
// Max takes the maximum of two values. If they are considered equal, the first argument is chosen
func Max[A C.Ordered](a, b A) A {
if a > b {
return a
}
return b
}