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

Apply functions from an Iterable to values from another Iterable. This creates the cartesian product of functions and values.

@example
import * as I from "./iterable.ts";

const functions = I.wrap(
  (x: number) => x * 2,
  (x: number) => x + 1
);
const values = I.wrap(1, 2, 3);

const result = Array.from(I.apply(values)(functions));
// [2, 4, 6, 2, 3, 4] (2*1, 2*2, 2*3, 1+1, 2+1, 3+1)
function apply<A>(ua: Iterable<A>): <I>(ufai: Iterable<(a: A) => I>) => Iterable<I>;
§
apply<A>(ua: Iterable<A>): <I>(ufai: Iterable<(a: A) => I>) => Iterable<I>
[src]

§Type Parameters

§Parameters

§
ua: Iterable<A>
[src]

§Return Type

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