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

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>;
§
apply<B, A>(ua: SyncEither<B, A>): <J, I>(ufai: SyncEither<J, (a: A) => I>) => SyncEither<B | J, I>
[src]

§Type Parameters

§Parameters

§Return Type

§
<J, I>(ufai: SyncEither<J, (a: A) => I>) => SyncEither<B | J, I>
[src]