Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Foldable ¶
type Foldable[A, B, HKTA any] interface { // Reduce folds the structure from left to right using a binary function and initial value. Reduce(func(B, A) B, B) func(HKTA) B // ReduceRight folds the structure from right to left using a binary function and initial value. ReduceRight(func(B, A) B, B) func(HKTA) B // FoldMap maps each element to a monoid and combines them using the monoid's operation. FoldMap(m M.Monoid[B]) func(func(A) B) func(HKTA) B }
Foldable represents a data structure that can be folded/reduced to a single value.
Foldable provides operations to collapse a structure containing multiple values into a single summary value by applying a combining function.
Type Parameters:
- A: The type of elements in the structure
- B: The type of the accumulated result
- HKTA: The higher-kinded type containing A
Click to show internal directories.
Click to hide internal directories.