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

Apply a function to the Right value of an AsyncEither.

@example
import * as AE from "./async_either.ts";
import { pipe } from "./fn.ts";

const result = pipe(
  AE.right(5),
  AE.map(n => n * 2)
);

const value = await result(); // Right(10)
function map<A, I>(fai: (a: A) => I): <B>(ta: AsyncEither<B, A>) => AsyncEither<B, I>;
§
map<A, I>(fai: (a: A) => I): <B>(ta: AsyncEither<B, A>) => AsyncEither<B, I>
[src]

§Type Parameters

§Parameters

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

§Return Type

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