bimap -package:pgp-wordlist -package:base-prelude package:rio

Map over both arguments at the same time.
bimap f g ≡ first f . second g

Examples

>>> bimap toUpper (+1) ('j', 3)
('J',4)
>>> bimap toUpper (+1) (Left 'j')
Left 'J'
>>> bimap toUpper (+1) (Right 3)
Right 4
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.