<div dir="auto"><div>My instinct about fromEither's type was the same as Carter's, and I had to remind myself of fromMaybe. I like the name fromEither overall. Seems to fit well with precedent and is straightforward enough.<br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 17, 2020, 07:45 Oliver Charles <<a href="mailto:ollie@ocharles.org.uk">ollie@ocharles.org.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u><div><div>You may wish to compare with fromMaybe then, which probably also doesn't have the type you'd expect :) The type you have there is more like bifoldMap<br></div><div><br></div><div>On Thu, 17 Sep 2020, at 1:42 PM, Carter Schonwald wrote:<br></div><blockquote type="cite" id="m_-7624924350472738924qt"><div dir="auto">I’d expect fromEither to be <br></div><div dir="auto">Either a b -> (a-> c )-> (b-> c) -> c <br></div><div dir="auto"><br></div><div dir="auto">Nothing about the name fromEither is suggestive of the Either a a type <br></div><div><div><br></div><div><div dir="ltr">On Thu, Sep 17, 2020 at 3:45 AM Oliver Charles <<a href="mailto:ollie@ocharles.org.uk" target="_blank" rel="noreferrer">ollie@ocharles.org.uk</a>> wrote:<br></div><blockquote style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-color:rgb(204,204,204);border-left-style:solid;border-left-width:1px;padding-left:1ex"><div><u></u><br></div><div><div>Regardless of having a more abstract version, I'm +1 on Jon's suggestion, and those names. fromEither is something I have reached for many many times and been surprised it's not within arms reach.<br></div></div><div><div><br></div><div>On Thu, 17 Sep 2020, at 7:16 AM, Jon Purdy wrote:<br></div><blockquote type="cite" id="m_-7624924350472738924qt-m_-456023475396536941qt"><div dir="auto"><div>I’m strongly for these:<br></div><div dir="auto"><br></div><div dir="auto">Data.Tuple.dup :: a → (a, a)<br></div><div dir="auto"><br></div><div dir="auto">Data.Either.fromEither :: Either a a → a<br></div></div></blockquote></div></blockquote></div></div></blockquote><div><br></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></div></div>