instance Foldable f => Foldable (IdentityT f) where
foldMap f (IdentityT a) = foldMap f a
instance Traversable f => Traversable (IdentityT f) where
traverse f (IdentityT a) = IdentityT <$> traverse f a
instance Foldable f => Foldable (Strict.WriterT w f) where
foldMap f (Strict.WriterT a) = foldMap (f . fst) a
instance Traversable f => Traversable (Strict.WriterT w f) where
traverse f (Strict.WriterT a) = Strict.WriterT <$> traverse f' a where
f' (a, b) = fmap (\c -> (c, b)) (f a)
instance Foldable f => Foldable (Lazy.WriterT w f) where
foldMap f (Lazy.WriterT a) = foldMap (f . fst) a
instance Traversable f => Traversable (Lazy.WriterT w f) where
traverse f (Lazy.WriterT a) = Lazy.WriterT <$> traverse f' a where
f' (a, b) = fmap (\c -> (c, b)) (f a)
instance Foldable f => Foldable (ErrorT e f) where
foldMap f (ErrorT a) = foldMap (foldMap f) a
instance Traversable f => Traversable (ErrorT e f) where
traverse f (ErrorT a) = ErrorT <$> traverse (traverse f) a
instance Foldable f => Foldable (MaybeT f) where
foldMap f (MaybeT a) = foldMap (foldMap f) a
instance Traversable f => Traversable (MaybeT f) where
traverse f (MaybeT a) = MaybeT <$> traverse (traverse f) a
instance Foldable f => Foldable (ListT f) where
foldMap f (ListT a) = foldMap (foldMap f) a
instance Traversable f => Traversable (ListT f) where
traverse f (ListT a) = ListT <$> traverse (traverse f) a