apply
import { apply } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/async_either.ts";Apply a function wrapped in an AsyncEither to a value wrapped in an AsyncEither.
@example
import * as AE from "./async_either.ts";
import { pipe } from "./fn.ts";
const asyncEitherFn = AE.right((n: number) => n * 2);
const asyncEitherValue = AE.right(5);
const result = pipe(
asyncEitherFn,
AE.apply(asyncEitherValue),
);
const value = await result(); // Right(10)
function apply<A, B>(ua: AsyncEither<B, A>): <I, J>(ufai: AsyncEither<J, (a: A) => I>) => AsyncEither<B | J, I>;
§
apply<A, B>(ua: AsyncEither<B, A>): <I, J>(ufai: AsyncEither<J, (a: A) => I>) => AsyncEither<B | J, I>
[src]§Parameters
§
ua: AsyncEither<B, A>
[src]§Return Type
§
<I, J>(ufai: AsyncEither<J, (a: A) => I>) => AsyncEither<B | J, I>
[src]