The equality for T
.
The list of grouped sub-list.
import { fromString, group, toArray, toString } from "./list.ts";
import * as Option from "./option.ts";
import { assertEquals } from "../deps.ts";
import { strict } from "./type-class/partial-eq.ts";
const grouped = toArray(group(strict<string>())(fromString("Mississippi")))
.map((list) => toString(list));
assertEquals(grouped, ["M", "i", "ss", "i", "ss", "i", "pp", "i"]);
Generated using TypeDoc
Groups the list into sub-lists when adjacent elements are equal.