Table of Contents

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> MapFirst<T>(Func<T1, T> f)

Parameters

f Func<T1, T>

The function to transform the first case with.

Returns

Either<T, T2, T3, T4, T5, T6, T7>

An either whose first case has type T. It holds the result of f if this held the first case, and otherwise the same case and value as this.

Type Parameters

T

The type that the first case becomes.

Remarks

This calls f only when this holds the first case.