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

map

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

Apply a function to the Right value of a These.

@example
import { map, right, both } from "./these.ts";
import { pipe } from "./fn.ts";

const result1 = pipe(right(5), map(n => n * 2));
console.log(result1); // { tag: "Right", right: 10 }

const result2 = pipe(both("Warning", 5), map(n => n * 2));
console.log(result2); // { tag: "Both", left: "Warning", right: 10 }
function map<A, I>(fai: (a: A) => I): <B>(ta: These<B, A>) => These<B, I>;
§
map<A, I>(fai: (a: A) => I): <B>(ta: These<B, A>) => These<B, I>
[src]

§Type Parameters

§Parameters

§
fai: (a: A) => I
[src]

§Return Type

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