Method MapFirst
- Namespace
- SodaFlow.Functional
- Assembly
- SodaFlow.Functional.dll
MapFirst<T>(Func<T1, T>)
Transforms the value if this holds the first case, and passes each other case through unchanged.
public Either<T, T2, T3, T4, T5, T6, T7, T8> MapFirst<T>(Func<T1, T> f)
Parameters
fFunc<T1, T>The function to transform the first case with.
Returns
- Either<T, T2, T3, T4, T5, T6, T7, T8>
An either whose first case has type
T. It holds the result offif this held the first case, and otherwise the same case and value as this.
Type Parameters
TThe type that the first case becomes.
Remarks
This calls f only when this holds the first case.