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

Given L => A => I and D => A create a new Fn D & L => I. In order to preserve type widening for ap, it only handles unary functions.

@example
import * as F from "./fn.ts";

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

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

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

§Type Parameters

§Parameters

§
ua: Fn<D, A>
[src]

§Return Type

§
<L, I>(ufai: Fn<L, (a: A) => I>) => Fn<D & L, I>
[src]