The transposed list.
import { fromArray, transpose, toArray } from "./list.ts";
import { assertEquals } from "../deps.ts";
const matrix = fromArray([fromArray([1, 2, 3]), fromArray([4, 5, 6])]);
const transposed = transpose(matrix);
const actual = toArray(transposed).map((col) => toArray(col));
assertEquals(actual, [
[1, 4],
[2, 5],
[3, 6],
]);
Generated using TypeDoc
Transposes the rows and columns. Passing an infinite list will hang forever.