Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

mapSecond

import { mapSecond } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/fn_either.ts";

Map over the left return value of a FnEither.

@example
import * as FE from "./fn_either.ts";
import { pipe } from "./fn.ts";

const result1 = pipe(
  FE.id<number>(),
  FE.mapSecond((n: number) => n + 1),
)(0); // Right(0)

const result2 = pipe(
  FE.idLeft<number>(),
  FE.mapSecond(n => n + 1),
)(0); // Left(1)
function mapSecond<B, J>(fbj: (b: B) => J): <A = never, D = unknown>(ua: FnEither<D, B, A>) => FnEither<D, J, A>;
§
mapSecond<B, J>(fbj: (b: B) => J): <A = never, D = unknown>(ua: FnEither<D, B, A>) => FnEither<D, J, A>
[src]

§Type Parameters

§Parameters

§
fbj: (b: B) => J
[src]

§Return Type

§
<A = never, D = unknown>(ua: FnEither<D, B, A>) => FnEither<D, J, A>
[src]