Rotate matrix rows according to the row above
Husk, 4 bytes

G(ṙ←


Try it online!

Rotates rows to the left.

Explanation

G in Husk is scanl (or cumulative reduce from left, as some languages call it). When given a function of type x-&gt;x-&gt;x (like in this case) it can use as starting value the first element of the list.

( is needed here to combine the following two functions into a single one.

ṙ is "rotate to the left" and takes a number and a list as arguments.

← returns the first element of a list.