intercalcate
import { intercalcate } from "https://raw.githubusercontent.com/baetheus/fun/main/initializable.ts";
Create a initializable that works like Array.join, inserting middle between every two values that are combineenated. This can have some interesting results.
@example
import * as M from "./initializable.ts";
import * as S from "./string.ts";
import { pipe } from "./fn.ts";
const { combine: toList } = pipe(
S.InitializableString,
M.intercalcate(", "),
);
const list = pipe(
"apples",
toList("oranges"),
toList("and bananas"),
); // list === "apples, oranges, and bananas"