mainDiag :: [[a]] -> [a] mainDiag x = zipWith (!!) x [0..]
有人可以解释一下这段代码(特别是zipWith (!!))以及它如何返回矩阵的对角线?
zipWith (!!)
haskell
haskell ×1