Proposal: add foldMapA to Data.Foldable or Control.Applicative

Vanessa McHale vanessa.mchale at iohk.io
Wed May 8 01:56:50 UTC 2019


It's relatively easy to define foldMapA, viz.

foldMapA ::  (Monoid b, Traversable t, Applicative f) => (a -> f b) -> t
a -> f b
foldMapA = (fmap fold .) . traverse

I've used found it useful once so far:
http://hackage.haskell.org/package/dir-traverse-0.2.0.0/docs/src/System.Directory.Recursive.html#local-6989586621679024835

Cheers,
Vanessa McHale


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20190507/064c2ae1/attachment.sig>


More information about the Libraries mailing list