<html><head></head><body>Hopping on the bikeshed, I've heard 'Either a a -> a' described as 'untagging' the 'a'. So from a less categorical perspective, I'd call it<br>+ 'untag' (already used in Data.Tagged) <br>+ or 'unEither' (because you're directly unwrapping the Either, not using a fallback value like 'fromMaybe').<br><br>Either of these should be more immediately clear than 'codiag', 'codup', or 'dedup', which would make more sense as (categorical) class methods.<br><br>--Keith<br><br>Sent from my phone with K-9 Mail.<br><br><div class="gmail_quote">On September 17, 2020 1:33:40 PM UTC, Carter Schonwald <carter.schonwald@gmail.com> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div dir="auto">I’m not sure how fromMaybe relates here. Could someone explain?</div><div dir="auto"><br></div><div dir="auto">For the anti-categorical folks who dislike codiag or related names like trace (in linear algebra trace is the sum of the diagonal of a matrix as a scalar, an apt analogy I think), another name that I think is descriptive is collapse </div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">Names bandied about so far: </div><div dir="auto"><br></div><div dir="auto">Dedup </div><div dir="auto">Codiag</div><div dir="auto">Fromeither </div><div dir="auto"><br></div><div dir="auto">Things I mentioned above : trace and collapse </div><div dir="auto"><br></div><div dir="auto">Zooming out though, this operation is equiv to “either id id”, so I don’t really see how inventing a new name for this specific tiny snippet really helps anyone. </div><div dir="auto"><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 17, 2020 at 8:54 AM chessai <<a href="mailto:chessai1996@gmail.com">chessai1996@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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></div></div><div dir="auto"><div><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" target="_blank">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_-8166797737212689159m_-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" rel="noreferrer" target="_blank">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_-8166797737212689159m_-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><br><br>Libraries mailing list<br><br><br><a href="mailto:Libraries@haskell.org" rel="noreferrer" target="_blank">Libraries@haskell.org</a><br><br><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><br><br></blockquote></div></div></div><br><br></blockquote></div></div>
</blockquote></div></body></html>