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

Given a FnEither returning a function A => I and a FnEither returning a value A, combine them into a FnEither returning an I.

@example
import * as FE from "./fn_either.ts";
import { pipe } from "./fn.ts";

type Person = { name: string; age: number };

const person = (name: string) => (age: number): Person => ({ name, age });

const result = pipe(
  FE.wrap(person),
  FE.apply(FE.wrap("Brandon")),
  FE.apply(FE.wrap(37)),
); // FnEither<[], never, Person>
function apply<D, B, A>(ua: FnEither<D, B, A>): <L, I, J>(ufai: FnEither<L, J, (a: A) => I>) => FnEither<D & L, B | J, I>;
§
apply<D, B, A>(ua: FnEither<D, B, A>): <L, I, J>(ufai: FnEither<L, J, (a: A) => I>) => FnEither<D & L, B | J, I>
[src]

§Type Parameters

§Parameters

§
ua: FnEither<D, B, A>
[src]

§Return Type

§
<L, I, J>(ufai: FnEither<L, J, (a: A) => I>) => FnEither<D & L, B | J, I>
[src]