<div dir="ltr">If your objection is that you find the choice of <font face="courier new, monospace">Bifunctor</font> a more natural axis upon which to generalize than <font face="courier new, monospace">Arrow</font>, I happen to agree.<div>
<br></div><div>If the proposal was to bring in the core of <font face="courier new, monospace">bifunctors</font> into <font face="courier new, monospace">base</font> (e.g. <font face="courier new, monospace">Data.Bifunctor</font>, <font face="courier new, monospace">Data.Bifoldable</font>, <font face="courier new, monospace">Data.Bitraversable</font>), I'd be an enthusiastic +1.</div>
<div><br></div><div>I am, however, strongly against adding a <font face="courier new, monospace">mapRight</font> in a world with <font face="courier new, monospace">fmap</font><font face="arial, helvetica, sans-serif">, </font>I mean before you know it we'd be using a special map for lists! ;)</div>
<div><br></div><div>-Edward</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Apr 20, 2014 at 1:20 PM, Dominique Devriese <span dir="ltr"><<a href="mailto:dominique.devriese@cs.kuleuven.be" target="_blank">dominique.devriese@cs.kuleuven.be</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">First, here is a link to a post by Andreas in a previous discussion on<br>
this list about the same topic<br>
 <a href="http://www.haskell.org/pipermail/libraries/2013-August/020549.html" target="_blank">http://www.haskell.org/pipermail/libraries/2013-August/020549.html</a><br>
<br>
Speaking only for myself, I would happily support a generalisation<br>
like "mapEither is just a special case of Bifunctor.fmapBoth".<br>
However, I'm unsatisfied with "mapEither is just a special case of<br>
Control.Arrow.(+++)". The reason is that when I need, e.g., the<br>
mapEither function, I'm looking for a function of type "(a -> b) -> (c<br>
-> d) -> Either a c -> Either b d".  To find such a function, I focus<br>
on the Eithers in this signature and start looking for a function<br>
related to the Either data type, or some generalisation of it.  I<br>
would naturally expect to find such a function in Data.Either or<br>
Data.Bifunctor or similar places. However, in order to find<br>
Control.Arrow.(+++), I would instead have to focus on the (->)s in the<br>
signature and look for a function that works on a generalisation of<br>
the (->)s, i.e. Arrow.  For me, and I expect also for beginners and<br>
people unacquainted with arrows, I think this is *not* an obvious<br>
generalisation.<br>
<br>
As for a concrete counter-proposal, I would propose to amend Tobias'<br>
original proposal with three bikeshedding modifications (partially<br>
overlapping with other people's suggestion in this thread and the one<br>
from 2013):<br>
* rename bimap to mapEither (or perhaps mapBoth)<br>
* implement the functions as renames when possible: "mapEither =<br>
Control.Arrow.(+++)" and similarly.<br>
* also add "mapRight :: (a -> b) -> Either c a -> Either c b"<br>
<br>
Regards,<br>
Dominique<br>
<br>
2014-04-20 17:52 GMT+02:00 Herbert Valerio Riedel <<a href="mailto:hvr@gnu.org">hvr@gnu.org</a>>:<br>
<div class="HOEnZb"><div class="h5">> On 2014-04-20 at 17:29:39 +0200, Dominique Devriese wrote:<br>
>> 2014-04-20 14:29 GMT+02:00 Andreas Abel <<a href="mailto:andreas.abel@ifi.lmu.de">andreas.abel@ifi.lmu.de</a>>:<br>
>>> On 20.04.2014 07:16, João Cristóvão wrote:<br>
>>>>> given arrowchoice, i withdraw my proposal. thank you for pointing<br>
>>>>> me<br>
>>>> there.<br>
>>>><br>
>>>> Please don't.<br>
>>><br>
>>> +1<br>
>>><br>
>>> Stuff like this belongs in Data.Either, not in Control.Arrow.  We had<br>
>>> the same issue for Data.Tuple vs. Control.Arrow a while ago.<br>
>><br>
>> +1<br>
><br>
> I'm slightly confused, what are you exactly voting for? For augmenting<br>
> the documentation in Data.Either to mentioning e.g. Control.Arrows (or<br>
> even Bifunctor), or rather for adding new functions to Data.Either?<br>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/libraries" target="_blank">http://www.haskell.org/mailman/listinfo/libraries</a><br>
</div></div></blockquote></div><br></div>