• Composes two functions mathematically. compose(f)(g)(x) means f(g(x)).

    Type Parameters

    • U

    • V

    Parameters

    • f: Fn<U, V>

      The function to do at last.

    Returns (<T>(g) => ((t) => V))

    The composed function.

    Examples

    import { assertEquals } from "../deps.ts";
    import { compose } from "./func.ts";

    assertEquals(compose((x: number) => x + 1)((x: number) => x * 2)(3), 7);
      • <T>(g): ((t) => V)
      • Type Parameters

        • T

        Parameters

        • g: Fn<T, U>

        Returns ((t) => V)

          • (t): V
          • Parameters

            • t: T

            Returns V

Generated using TypeDoc