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:
@@ -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
|
||||
|
Reference in New Issue
Block a user