fold<T> method
T
fold<T>(
- T onLeft(
- L
- T onRight(
- R
Folds this Either into a single value
Implementation
T fold<T>(T Function(L) onLeft, T Function(R) onRight) {
return switch (this) {
Left(:final value) => onLeft(value),
Right(:final value) => onRight(value),
};
}