<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Interestingly, in the case of dir-traverse, <br>
<br>
foldMapA = (fmap fold .) . traverse<br>
<br>
ends up being faster than<br>
<br>
foldMapA f = getAp . foldMap (Ap . f)<br>
<br>
...which I did not expect. I suppose we should benchmark this
before adding it to base.<br>
<br>
Cheers,<br>
Vanessa McHale<br>
</p>
<div class="moz-cite-prefix">On 5/9/19 12:49 PM, chessai . wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAD34_k+_aJOwjPkqfkdd-eATG-g09VRSuxWMC+6xVrP4N9Lw9g@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="auto">I've also defined this in multiple of my own
projects/codebases, and I provided it as a motivation for
introducing Data.Monoid.Ap in the first place.
<div dir="auto"><br>
</div>
<div dir="auto">I'm +1 on the inclusion of foldMapA.</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Thu, May 9, 2019, 11:10 AM
Matt <<a href="mailto:parsonsmatt@gmail.com"
moz-do-not-send="true">parsonsmatt@gmail.com</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">I've personally defined `foldMapA` in at least
three private projects, and I've one-off written it probably
over a dozen times. Each time I've used something like `fmap
k . traverse f` where `k` is one of `mconcat`, `fold`,
`join`, etc. I appreciate the subtle discussion on the
implementation for performance and I think it'd be awesome
to have this defined in `base`.<br clear="all">
<div>
<div dir="ltr"
class="m_-8112066746636068220gmail_signature"
data-smartmail="gmail_signature">
<div dir="ltr">
<div><br>
</div>
<div>Matt Parsons</div>
</div>
</div>
</div>
<br>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Tue, May 7, 2019 at
10:36 PM David Feuer <<a
href="mailto:david.feuer@gmail.com" target="_blank"
rel="noreferrer" moz-do-not-send="true">david.feuer@gmail.com</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div dir="auto">
<div>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, May 8,
2019, 12:12 AM Bryan Richter <<a
href="mailto:b@chreekat.net" target="_blank"
rel="noreferrer" moz-do-not-send="true">b@chreekat.net</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px
0px 0px 0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div dir="auto">
<div>Hi David,</div>
<div dir="auto"><br>
</div>
<div dir="auto">At the risk of invoking the gods
of Language Blorp, I will note that as a
working programmer I know exactly what
Applicative, Traversable, and Monoid are (from
Vanessa's original proposal), but the
unfortunately-named getAp is something I will
only learn about begrudgingly.</div>
</div>
</blockquote>
</div>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">That seems unfortunate. Learning to use
such types is pretty useful. I'd recommend that every
Haskell programmer get to know all the types in
Data.Monoid and come to an understanding of what
they're good for.</div>
<div dir="auto"><br>
</div>
<div dir="auto">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px
0px 0px 0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div dir="auto">
<div dir="auto"><br>
</div>
<div dir="auto">What you consider "so simple we
don't need to define it" took a rather lengthy
email to describe. Are you sure it's not worth
actually defining?</div>
</div>
</blockquote>
</div>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">So ... that long post was about trying
to prove what I intuitively thought *must* be true. In
the end, I wasn't quite able to finish the proof, but
I did at least manage to convince myself that my
intuition was correct. It's true that this sort of
intuition takes a certain amount of time to develop.
In the case of a really important operation, yeah, we
should package it up. But is this operation important
enough? I'm not really convinced yet.</div>
<div dir="auto"><br>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px
0px 0px 0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div dir="auto">
<div dir="auto"> If nothing else, the next time
someone searches Hoogle for a function
matching its type signature, perhaps it will
be an opportunity for someone like me to peer
beneath the hood and learn something new.</div>
</div>
</blockquote>
</div>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">That's valid. But ... there are lots of
opportunities for that sort of thing already. Is it
worth the API clutter to add another one?</div>
</div>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank"
rel="noreferrer" moz-do-not-send="true">Libraries@haskell.org</a><br>
<a
href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries"
rel="noreferrer noreferrer" target="_blank"
moz-do-not-send="true">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
</blockquote>
</div>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank"
rel="noreferrer" moz-do-not-send="true">Libraries@haskell.org</a><br>
<a
href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries"
rel="noreferrer noreferrer" target="_blank"
moz-do-not-send="true">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
</blockquote>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Libraries mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Libraries@haskell.org">Libraries@haskell.org</a>
<a class="moz-txt-link-freetext" href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a>
</pre>
</blockquote>
</body>
</html>