Skip to content

mapFirst

mapFirst<A, C>(f): <B>(data) => These<C, B>

Defined in: Core/These.ts:107

Transforms the first value, leaving the second unchanged.

A

C

(a) => C

<B>(data): These<C, B>

B

These<A, B>

These<C, B>

pipe(These.first(5), These.mapFirst(n => n * 2));           // First(10)
pipe(These.both(5, "warn"), These.mapFirst(n => n * 2));    // Both(10, "warn")
pipe(These.second("warn"), These.mapFirst(n => n * 2));     // Second("warn")