I want to use nested lists of nestedness 2 to represent matrix (e.g. [[1,2,3],[4,5,6]]). How would I define a function that process small submatrices (say 2*2)? I expected something like this:
f (a1:a2:a) : (b1:b2:b) : x = ...
Where a1, a2 are two consecutive elements of first row and b1, b2 — second row. a, b are rests of first and second row correspondigly. x is the rest of matrix rows.
But this clearly doesn’t work.
Thanks in advance!
You’ve got the right idea. All you’re missing is a pair of parentheses: