Вот мой пример решения:
-module(transp).
-export([transpose/1]).
transpose(L) ->
transpose_do([], L).
transpose_do(Acc, [[]|_]) ->
lists:reverse(Acc);
transpose_do(Acc, M) ->
Row = lists:foldr(
fun(Elem, FoldAcc) ->
[hd(Elem) | FoldAcc]
end,
[],
M),
transpose_do([Row|Acc], lists:map(fun(X) -> tl(X) end, M)).
Тест:
1> M = [[a1,a2,a3],[b1,b2,b3],[c1,c2,c3]].
[[a1,a2,a3],[b1,b2,b3],[c1,c2,c3]]
2> transp:transpose(M).
[[a1,b1,c1],[a2,b2,c2],[a3,b3,c3]]