Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Add ¶ added in v0.3.0
func Add[T constraints.Integer | constraints.Float | ~string](a, b T) T
Add performs the `+` operation for the two inputs, returning the result.
Example ¶
package main
import (
"fmt"
"github.com/BooleanCat/go-functional/iter"
"github.com/BooleanCat/go-functional/iter/ops"
)
func main() {
total := iter.Fold[int](iter.Lift([]int{1, 2, 3}), 0, ops.Add[int])
fmt.Println(total)
}
Output: 6
func UnwrapOption ¶
UnwrapOption may be used as an operation for iter.Map in order to unwrap all options in an iterator.
func UnwrapResult ¶
UnwrapResult may be used as an operation for iter.Map in order to unwrap all results in an iterator.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.