so i was asked to write a function diag :: [[a]] -> [a]
in haskell for my weekly assignment which returns all diagonals of a well-formed matrix like:
Resulting in the list: [a11,a12,a21,a13,a22,a31,a14,a23,a32,a24,a33,a34]
.
Since we're not allowed to use any third-party packages like Data.matrix and me not beeing able to completly understand the implementation in this post i would appreciate your help with this one.
EDIT:
I understood this one, but it only returns one diagonal in the wrong order. I also understood the math, but it didn't really help me either.