Matrix transposition: Difference between revisions

m
→‎JS ES6: Defined transposition of empty matrix
m (→‎JS ES6: Defined transposition of empty matrix)
Line 2,168:
// transpose :: [[a]] -> [[a]]
const transpose = xs =>
xs[0] < xs.maplength ? (
(_, iCol) => xs[0].map(
row(_, iCol) => row[iCol]xs.map(
row => row[iCol]
)
)
) : [];
 
 
Line 2,184 ⟶ 2,186:
])
);
 
 
// MAIN ---
9,655

edits