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