module Data.Foldable.Ext ( foldMapA
                         ) where

import           Data.Foldable (fold)

foldMapA :: (Applicative f, Traversable t, Monoid m) => (a -> f m) -> t a -> f m
foldMapA :: (a -> f m) -> t a -> f m
foldMapA = ((t m -> m) -> f (t m) -> f m
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap t m -> m
forall (t :: * -> *) m. (Foldable t, Monoid m) => t m -> m
fold (f (t m) -> f m) -> (t a -> f (t m)) -> t a -> f m
forall b c a. (b -> c) -> (a -> b) -> a -> c
.) ((t a -> f (t m)) -> t a -> f m)
-> ((a -> f m) -> t a -> f (t m)) -> (a -> f m) -> t a -> f m
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (a -> f m) -> t a -> f (t m)
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse