• Maps and flattens the hom with fn.

    Type Parameters

    • X

    Returns (<A, B>(fn) => ((a) => Fn<X, B>))

    The mapped hom X => B.

    Examples

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

    const mapper = flatMap<number>()((x: number) => (y: number) => x * y);
    assertEquals(mapper((x) => x + 1)(3), 12);
      • <A, B>(fn): ((a) => Fn<X, B>)
      • Type Parameters

        • A

        • B

        Parameters

        • fn: ((a) => Fn<X, B>)
            • (a): Fn<X, B>
            • Parameters

              • a: A

              Returns Fn<X, B>

        Returns ((a) => Fn<X, B>)

          • (a): Fn<X, B>
          • Parameters

            • a: Fn<X, A>

            Returns Fn<X, B>

Generated using TypeDoc