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

Apply a function wrapped in a Free to a value wrapped in a Free.

@example
import { apply, node } from "./free.ts";
import { pipe } from "./fn.ts";

const freeFn = node((n: number) => n * 2);
const freeValue = node(5);
const result = pipe(
  freeFn,
  apply(freeValue)
);

console.log(result); // { tag: "Node", value: 10 }
function apply<A>(ua: Free<A>): <I>(ufai: Free<(a: A) => I>) => Free<I>;
§
apply<A>(ua: Free<A>): <I>(ufai: Free<(a: A) => I>) => Free<I>
[src]

§Type Parameters

§Parameters

§Return Type

§
<I>(ufai: Free<(a: A) => I>) => Free<I>
[src]