MCPcopy
hub / github.com/samber/mo / Foldable

Interface Foldable

fold.go:8–12  ·  view source on GitHub ↗

Foldable represents a type that can be folded into a single value based on its state. - T: the type of the value in the failure state (e.g., an error type). - U: the type of the value in the success state.

Source from the content-addressed store, hash-verified

6// - T: the type of the value in the failure state (e.g., an error type).
7// - U: the type of the value in the success state.
8type Foldable[T any, U any] interface {
9 leftValue() T
10 rightValue() U
11 hasLeftValue() bool
12}
13
14// Fold applies one of the two functions based on the state of the Foldable type,
15// and it returns the result of applying either successFunc or failureFunc.

Callers 3

FoldFunction · 0.65
FoldFunction · 0.65
FoldFunction · 0.65

Calls

no outgoing calls

Tested by

no test coverage detected