Skip to content

map

map<A, B>(f): <E>(data) => These<E, B>

Defined in: Core/These.ts:99

Transforms the success value, leaving the error unchanged.

A

B

(a) => B

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

E

These<E, A>

These<E, B>

pipe(These.ok(5), These.map(n => n * 2));          // Ok(10)
pipe(These.both("warn", 5), These.map(n => n * 2)); // Both("warn", 10)
pipe(These.err("err"), These.map(n => n * 2));      // Err("err")