Help me to explain the F# Matrix transpose function

前端 未结 5 788
后悔当初
后悔当初 2020-12-01 14:54

There is a Matrix transpose function:

let rec transpose = function
    | (_::_)::_ as M -> List.map List.head M :: transpose (List.map Li         


        
5条回答
  •  旧巷少年郎
    2020-12-01 15:24

    This maps head over the lists to extract the first column and uses that to form the first row prepended to the result of transposing the remaining columns.

提交回复
热议问题