t :: (Applicative f, Applicative g) => f a -> g apreserving the Applicative operations:
t (pure x) = pure x t (f <*> x) = t f <*> t xand the identity functor Identity and composition functors Compose are from Data.Functor.Identity and Data.Functor.Compose. Some simple examples are Either and (,):
instance Bitraversable Either where bitraverse f _ (Left x) = Left <$> f x bitraverse _ g (Right y) = Right <$> g y instance Bitraversable (,) where bitraverse f g (x, y) = (,) <$> f x <*> g yBitraversable relates to its superclasses in the following ways:
bimap f g ≡ runIdentity . bitraverse (Identity . f) (Identity . g) bifoldMap f g = getConst . bitraverse (Const . f) (Const . g)These are available as bimapDefault and bifoldMapDefault respectively.