<div dir="ltr"><div class="gmail_extra">On Fri, Apr 25, 2014 at 1:14 PM, Andreas Abel <span dir="ltr"><<a href="mailto:andreas.abel@ifi.lmu.de" target="_blank">andreas.abel@ifi.lmu.de</a>></span> wrote:<br><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I am unhappy about the name "bifor".<br>
<br>
forM = flip mapM, so the right generalizations would be<br>
<br>
for = flip map<br>
bifor = flip bimap<br>
<br>
forA = flip mapA = flip traverse<br>
biforA = flip bimapA = flip bitraverse<br></blockquote><div><br><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">These definitions make no sense to me. flip bimap and flip bitraverse just swap the order of the traversal functions passed in. Their definition in bifunctors actually moves the structure to the first argument, which is the actual point of for(M).<br>
</div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Unfortunately, "for" was taken for "flip traverse" by<br>
Data.Traversable. Instead "forA" should have been used.<br></blockquote><div><br><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I don't find this to be unfortunate at all. Sorry. for is useful, and forA is a worse name (as is forM). Especially as we'll be able to get rid of sequenceA (and thus bisequenceA) in 7.10 with the improved hierarchy, leaving no -A functions aside from liftAN. I don't know if we will do that, but it's _not_ the convention to name these functions fooA. And I'm not in favor of making it the convention, either.<br>
</div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
In my own code, I actually define<br>
<br>
for = flip map<br>
<br>
and use it in situations like<br>
<br>
let ys = for xs $ \ x -><br>
long<br>
function<br>
body<br>
<br>
(I never use "for" from Data.Traversable anyway, since I have not<br>
needed yet an Applicative which is not a Monad.)<br></blockquote><div><br><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">And in base we don't do that.</div><br><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">
In my code, I use (<&>) from lens when I need a flipped fmap:<br><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"> let ys = xs <&> \x -> ...<br><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">
and do use Applicative for.<br></div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Proposal: use "biforA" instead of "bifor".<br>
</blockquote><div><br><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;display:inline">Negative.</div><br></div></div></div></div>