The mapAccumWithKeyL function behaves like a combination of mapWithKey
and foldlWithKey; it applies a function to each element of a structure,
passing an accumulating parameter from left to right, and returning
a final value of this accumulator together with the new structure.

The mapAccumWithKeyR function behaves like a combination of mapWithKey
and foldrWithKey; it applies a function to each element of a structure,
passing an accumulating parameter from right to left, and returning
a final value of this accumulator together with the new structure.