• Folds the elements of list from left.

    Type Parameters

    • T

    • U

    Parameters

    • f: ((a) => ((b) => U))

      The fold operation.

        • (a): ((b) => U)
        • Parameters

          • a: U

          Returns ((b) => U)

            • (b): U
            • Parameters

              • b: T

              Returns U

    Returns ((init) => ((list) => U))

    The folded value.

    Examples

    import { foldL, fromString } from "./list.ts";
    import { assertEquals } from "../deps.ts";

    assertEquals(
    foldL((x: string) => (y: string) => y + x)("")(fromString("hoge")),
    "egoh",
    );
    assertEquals(
    foldL((x: string) => (y: string) => y + x)("")(fromString("")),
    "",
    );
      • (init): ((list) => U)
      • Parameters

        • init: U

        Returns ((list) => U)

          • (list): U
          • Parameters

            Returns U

Generated using TypeDoc