mapLeft<L1, L2, R> function

TaskEither<L2, R> Function(TaskEither<L1, R> taskEither) mapLeft<L1, L2, R>(
  1. L2 f(
    1. L1 value
    )
)

Transform a TaskEither's value if it is Left.

expect(
  await left('fail').chain(mapLeft((s) => '${s}ure'))(),
  E.left('failure'),
);

Implementation

TaskEither<L2, R> Function(TaskEither<L1, R> taskEither) mapLeft<L1, L2, R>(
  L2 Function(L1 value) f,
) =>
    (fa) => TaskEither(fa.p(task.map(either.mapLeft(f))));