• Joins separator items among each list of the list.

    Type Parameters

    • T

    Parameters

    • separator: List<T>

      The separator element.

    Returns ((listList) => List<T>)

    The joined list.

    Examples

    import { empty, fromArray, fromString, intercalate, singleton, toString } from "./list.ts";
    import { assertEquals } from "../deps.ts";

    assertEquals(intercalate(singleton(0))(empty()), empty());

    const joined = intercalate(fromString(", "))(
    fromArray([fromString("foo"), fromString("bar"), fromString("bee")]),
    );
    assertEquals(toString(joined), "foo, bar, bee");

Generated using TypeDoc