<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">bimap is not a good name for this. There are too many things that can be bimapped, and they are abstracted over using the Bifunctor class in bifunctors, which has a method named bimap.<br>
<br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I also think people should just use Bifunctor, instead of one-off functions being added into several modules. But I could live with bimapEither existing, I suppose.<br>
<br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">-- Dan<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Apr 18, 2014 at 4:54 PM, Tobias Florek <span dir="ltr"><<a href="mailto:haskell@ibotty.net" target="_blank">haskell@ibotty.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">hi,<br>
<br>
i propose to include the following functions into Data.Either.<br>
<br>
    mapLeft :: (a->b) -> Either a c -> Either b c<br>
    mapLeft f = bimap f id<br>
<br>
    bimap :: (a -> b) -> (c -> d) -> Either a c -> Either b d<br>
    bimap f g = either (Left . f) (Right . g)<br>
<br>
bimap and mapLeft already exists in edward kmett's either library (and in categories-extras and in gabriel gonzales' errors), but imo they are very useful by itself to warrant an inclusion in base. given bimap, mapLeft might not cross the fairbairn threshold though.<br>

<br>
note: i don't propose exporting them from Prelude.<br>
<br>
discussion period: 2 weeks<br>
<br>
cheers,<br>
 tobias florek<br>
______________________________<u></u>_________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/libraries" target="_blank">http://www.haskell.org/<u></u>mailman/listinfo/libraries</a><br>
</blockquote></div><br></div>