Transpose an arbitrarily sized rectangular Matrix.




function transpose(A) {
    return map(range(sizeof A), function(k, idx) {
        return map(A, function(k, row) {
            return row[idx];
        });
    });
}