<html><head></head><body><div><div><div style="display: none; border: 0px; width: 0px; height: 0px; overflow: hidden; visibility: hidden;"><img src="https://r.superhuman.com/heAMnFsQpWdutTgLqQyMvca-7V5yR91Tzh65POY9DV_fc9kuQRqqsO9pR0ohCP8PqWOgEyAKGRfSt8oL6fAox9_uXNRzpOy3axkkrGeWUgWN5qkIoIygZE7z0pfPMRyqcaFnRy8t0tCBfx5rgRHqn8HegBAzHklrtRm8fG4zU-QGnZpPx1HlPx0.gif" alt=" " width="1" height="0" style="display: none; border: 0px; width: 0px; height: 0px; overflow: hidden; visibility: hidden;"/><!--                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                --></div><div><div><div>Nice! <br/><br/>That's kind of what I was going for with Carter earlier in the day, thanks Matthew. </div><div><br/></div><div>I think a diagonalization function and functor are both very sensible additions to `bifunctors` and `Data.Bifunctor`. The theory behind this is sound: The diagonalization functor Δ: Hask → Hask^Hask, forms the center of the adjoint triple `colim -| Δ -| lim : Hask → Hask^Hask`. <br/><br/>Certainly the function `diag :: a → (a,a)` is something I've seen written in several libraries, and should be included in `Data.Tuple` as a `base` function. The clear generalization of this function is `diag :: Biapplicative f ⇒ a → f a a`. I'm in favor of both existing in their separate capacities. </div><div><br/></div><div>Thoughts? <br/></div><div><br/></div><div>Emily</div></div><br/><div class="gmail_signature"></div></div><br/><div><div class="gmail_quote">On Wed, Sep 16, 2020 at 3:49 PM, Carter Schonwald <span dir="ltr"><<a href="mailto:carter.schonwald@gmail.com" target="_blank">carter.schonwald@gmail.com</a>></span> wrote:<br/><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra"><div class="gmail_quote sh-color-black sh-color" style="null" id="null"><div dir="auto" class="sh-color-black sh-color">Is the join bipure definition taking advantage of the (a->) monad instance?  Slick!</div><div dir="auto" class="sh-color-black sh-color"><br/></div><div dir="auto" class="sh-color-black sh-color"><br/></div><div class="sh-color-black sh-color"><div class="gmail_quote sh-color-black sh-color"><div class="gmail_attr sh-color-black sh-color" dir="ltr">On Wed, Sep 16, 2020 at 3:39 PM Matthew Farkas-Dyck <<a href="mailto:strake888@gmail.com" target="_blank" rel="noopener noreferrer">strake888@<wbr/>gmail.<wbr/>com</a>> wrote:<br/></div><blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex" class="gmail_quote sh-color-black sh-color">We also have<br/><br/><br/><br/>diag = join bipure<br/><br/><br/><br/>and (in pseudo-Haskell)<br/><br/><br/><br/>diag = unJoin . pure<br/><br/>  where<br/><br/>    newtype Join f a = Join { unJoin :: f a a } deriving (Functor)<br/><br/>    deriving instance Biapplicative f => Applicative (Join f)<br/><br/><br/><br/>The latter seems on its face potentially related to the instance for<br/><br/>lists of fixed length, but i am not sure how deep the connection may<br/><br/>be.<br/><br/></blockquote></div></div>

<p class="sh-color-black sh-color">_______________________________________________
<br/>
Libraries mailing list
<br/>
<a target="_blank" rel="noopener noreferrer" href="mailto:Libraries@haskell.org">Libraries@<wbr/>haskell.<wbr/>org</a>
<br/>
<a target="_blank" rel="noopener noreferrer" href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries">http:/<wbr/>/<wbr/>mail.<wbr/>haskell.<wbr/>org/<wbr/>cgi-bin/<wbr/>mailman/<wbr/>listinfo/<wbr/>libraries</a></p></div></div></blockquote></div></div><br/></div></div></body></html>