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/sync_either.ts";

Apply a function to the Left value of a SyncEither.

@example
import { mapSecond, left } from "./sync_either.ts";
import { pipe } from "./fn.ts";

const result = pipe(
  left("error"),
  mapSecond(e => `Error: ${e}`)
);

const value = result(); // Left("Error: error")
function mapSecond<B, J>(fbj: (b: B) => J): <A>(ta: SyncEither<B, A>) => SyncEither<J, A>;
§
mapSecond<B, J>(fbj: (b: B) => J): <A>(ta: SyncEither<B, A>) => SyncEither<J, A>
[src]

§Type Parameters

§Parameters

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

§Return Type

§
<A>(ta: SyncEither<B, A>) => SyncEither<J, A>
[src]