In Foldable t
, foldMap
is defined based on foldr
foldMap :: Monoid m => (a -> m) -> t a -> m
foldMap f = foldr (mappend . f) mempty
Can foldMap f
be defined equivalently in terms of fold
and f
?
I guess foldMap
is some kind of composition of fold
and f
, but fold . f
doesn't make sense.
Can foldMap f
be defined equivalently in terms of foldl
and f
?