The bimapAccumL function behaves like a combination of
bimap and bifoldl; it traverses a structure from left to
right, threading a state of type a and using the given
actions to compute new elements for the structure.
The bimapAccumR function behaves like a combination of
bimap and bifoldl; it traverses a structure from right
to left, threading a state of type a and using the given
actions to compute new elements for the structure.