bimap -package:pgp-wordlist -package:basement package:relude

Maps a function over both elements of a bifunctor.
>>> bimapBoth length ([True], [False, True])
(1,2)

>>> map (bimapBoth not) [Left True, Right False]
[Left False,Right True]
Fmaps functions for nested bifunctor. Short for fmap (bimap f g).
>>> bimapF not length $ Just (False, ['a', 'b'])
Just (True,2)
A default definition of bimap in terms of the Bitraversable operations.
bimapDefault f g ≡
runIdentity . bitraverse (Identity . f) (Identity . g)