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

fix: add more examples

Signed-off-by: Dr. Carsten Leue <carsten.leue@de.ibm.com>
This commit is contained in:
Dr. Carsten Leue
2023-08-11 16:26:15 +02:00
parent bb630810fc
commit e9f03e2d26
31 changed files with 11709 additions and 11035 deletions

View File

@@ -30,6 +30,13 @@ func Add[T Number](left T) func(T) T {
}
}
// Mul is a curried function used to add two numbers
func Mul[T Number](coeff T) func(T) T {
return func(value T) T {
return coeff * value
}
}
// Inc is a function that increments a number
func Inc[T Number](value T) T {
return value + 1