I know this is an old question, but recently I had to solve it as part of an exercise that I was doing, and I came across a solution @ sepp2k, but I could not understand how it works, so I tried to come to it using myself.
This is essentially the same algorithm, but a bit more concise, since it does not destroy the list of lists. I thought I would post it here in case someone else was looking, and might find a way to express it useful:
let rec transpose = function | [] | [] :: _ -> [] | rows -> List.map List.hd rows :: transpose (List.map List.tl rows)
naartjie
source share