<p dir="ltr">That's what I meant. Sorry; typing in my sleep!</p>
<div class="gmail_quote">On May 21, 2016 2:06 PM, "Andreas Abel" <<a href="mailto:abela@chalmers.se">abela@chalmers.se</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ah, yes, we want fromLeft and fromRight, but with types<br>
<br>
fromLeft :: a -> Either a b -> a<br>
fromRight :: b -> Either a b -> b<br>
<br>
where the first argument is the "default", like<br>
<br>
fromLeft a (Right b) = a<br>
<br>
Then you can write<br>
<br>
fromLeft impossible e<br>
<br>
where `impossible` does a controlled crash of your program. (See fromMaybe.)<br>
<br>
--Andreas<br>
<br>
On <a href="tel:21.05.2016%2015" value="+12105201615" target="_blank">21.05.2016 15</a>:16, Edward Kmett wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Sorry, I meant fromJust.<br>
<br>
On Sat, May 21, 2016 at 8:58 AM, David Feuer <<a href="mailto:david.feuer@gmail.com" target="_blank">david.feuer@gmail.com</a><br>
<mailto:<a href="mailto:david.feuer@gmail.com" target="_blank">david.feuer@gmail.com</a>>> wrote:<br>
<br>
No one wants to remove fromMaybe. In fact, it could serve as a<br>
template for total fromLeft and fromRight:<br>
<br>
fromLeft :: b -> (a -> b) -> Either a x -> b<br>
fromRight :: b -> (a -> b) -> Either x a -> b<br>
<br>
On May 21, 2016 8:55 AM, "Edward Kmett" <<a href="mailto:ekmett@gmail.com" target="_blank">ekmett@gmail.com</a><br>
<mailto:<a href="mailto:ekmett@gmail.com" target="_blank">ekmett@gmail.com</a>>> wrote:<br>
<br>
I'm personally -1 on this.<br>
<br>
A large portion of the community is vehemently against adding<br>
new partial functions, and they have to share base with the rest<br>
of us. I'd say more people want to remove fromMaybe, head, tail,<br>
etc. than want to double down on the pattern at this time.<br>
<br>
-Edward<br>
<br>
On Fri, May 20, 2016 at 4:08 PM, Anton Felix Lorenzen<br>
<<a href="mailto:anfelor@posteo.de" target="_blank">anfelor@posteo.de</a> <mailto:<a href="mailto:anfelor@posteo.de" target="_blank">anfelor@posteo.de</a>>> wrote:<br>
<br>
When working with Either,<br>
I am often missing two simple functions:<br>
fromRight :: Either a b -> b<br>
fromLeft :: Either a b -> a<br>
<br>
It has been implemented a couple of times:<br>
<a href="http://hayoo.fh-wedel.de/?query=fromRight" rel="noreferrer" target="_blank">http://hayoo.fh-wedel.de/?query=fromRight</a><br>
<br>
But I don't want to depend on yet another library<br>
for such a basic function.<br>
<br>
Could it be added?<br>
<br>
Anton<br>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a> <mailto:<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a>><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
<br>
<br>
<br>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a> <mailto:<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a>><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
<br>
</blockquote>
<br>
<br>
-- <br>
Andreas Abel <>< Du bist der geliebte Mensch.<br>
<br>
Department of Computer Science and Engineering<br>
Chalmers and Gothenburg University, Sweden<br>
<br>
<a href="mailto:andreas.abel@gu.se" target="_blank">andreas.abel@gu.se</a><br>
<a href="http://www2.tcs.ifi.lmu.de/~abel/" rel="noreferrer" target="_blank">http://www2.tcs.ifi.lmu.de/~abel/</a><br>
</blockquote></div>