Table of Contents

Method MapSecond

Namespace
SodaFlow.Functional
Assembly
SodaFlow.Functional.dll

MapSecond<T>(Func<T2, T>)

Transforms the value if this holds the second case, and passes each other case through unchanged.

public Either<T1, T> MapSecond<T>(Func<T2, T> f)

Parameters

f Func<T2, T>

The function to transform the second case with.

Returns

Either<T1, T>

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

Type Parameters

T

The type that the second case becomes.

Remarks

This calls f only when this holds the second case.