<div dir="auto"><div>Vanessa, it's very common for discussions about adding things to base (or containers, etc) to get into how those matters have been handled elsewhere. Many people think that it's better to pull ideas into base only after they've demonstrated their value elsewhere. Dmitriy's comment should definitely not be taken as criticism of your proposal.</div><div dir="auto"><br></div><div dir="auto">Dmitriy, there's no question that (#.) or similar should be used rather than (.). I didn't mention that because it doesn't seem to bear on the overall question of whether the function should be added, and I didn't want to confuse other participants with semi-obscure coercion operators.<br><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Thu, May 9, 2019, 10:28 AM Vanessa McHale <<a href="mailto:vanessa.mchale@iohk.io">vanessa.mchale@iohk.io</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <p>I appreciate the more efficient version, but I do not consider a
      package like relude to be an alternative to base (due to
      dependencies, maintenance).<br>
    </p>
    <div class="m_3497560899037736293moz-cite-prefix">On 5/8/19 10:50 PM, Dmitriy Kovanikov
      wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">I would like to add one more point of reference to
        the discussion. The `foldMapA` function is also implemented in
        the `relude` alternative prelude:
        <div><br>
        </div>
        <div><a href="http://hackage.haskell.org/package/relude-0.5.0/docs/src/Relude.Foldable.Fold.html#foldMapA" target="_blank" rel="noreferrer">http://hackage.haskell.org/package/relude-0.5.0/docs/src/Relude.Foldable.Fold.html#foldMapA</a><br>
        </div>
        <div><br>
        </div>
        <div>And the implementation already uses `Ap` and `getAp` as was
          discussed here. Previous implementation used `fmap` and
          `traverse` but it was changed to a more efficient one.</div>
        <div><br>
        </div>
        <div>One possible improvement: instead of current implementation</div>
        <div><br>
        </div>
        <div><span style="font-family:sans-serif">> foldMapA f =
            getAp . foldMap (Ap . f)</span><br>
        </div>
        <div><span style="font-family:sans-serif"><br>
          </span></div>
        <div><span style="font-family:sans-serif">It can be slightly
            more efficient (I guess) by using #. operator to coerce
            newtypes</span></div>
        <div><span style="font-family:sans-serif"><br>
          </span></div>
        <div><span style="font-family:sans-serif">> foldMapA f =
            getAp #. foldMap (Ap . f)</span><span style="font-family:sans-serif"><br>
          </span></div>
        <div><span style="font-family:sans-serif"><br>
          </span></div>
        <div><span style="font-family:sans-serif">The implementation in
            `relude` also contains recommended order of variables under
            `forall`. After using `foldMapA` in production for a while
            we've figured out in what order variables should go to
            resolve most often ambiguities via TypeApplication.</span></div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Wed, May 8, 2019 at 12:36
          PM David Feuer <<a href="mailto:david.feuer@gmail.com" target="_blank" rel="noreferrer">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">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">Libraries@haskell.org</a><br>
          <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
        </blockquote>
      </div>
      <br>
      <fieldset class="m_3497560899037736293mimeAttachmentHeader"></fieldset>
      <pre class="m_3497560899037736293moz-quote-pre">_______________________________________________
Libraries mailing list
<a class="m_3497560899037736293moz-txt-link-abbreviated" href="mailto:Libraries@haskell.org" target="_blank" rel="noreferrer">Libraries@haskell.org</a>
<a class="m_3497560899037736293moz-txt-link-freetext" href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" target="_blank" rel="noreferrer">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a>
</pre>
    </blockquote>
  </div>

_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank" rel="noreferrer">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
</blockquote></div></div></div>