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

bimap

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

Creates a new pair by mapping first through the fai function and second through the fbj function.

@example
import * as P from "./pair.ts";
import { pipe } from "./fn.ts";

const result = pipe(
  P.pair(1, 2),
  P.bimap(String, n => n + 1),
); // ['1', 3]
function bimap<A, B, I, J>(fbj: (b: B) => J, fai: (a: A) => I): (ta: Pair<A, B>) => Pair<I, J>;
§
bimap<A, B, I, J>(fbj: (b: B) => J, fai: (a: A) => I): (ta: Pair<A, B>) => Pair<I, J>
[src]

§Parameters

§
fbj: (b: B) => J
[src]
§
fai: (a: A) => I
[src]

§Return Type

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