Re: characterization of subset of Monads that respect tail calls?
Carter Schonwald <[email protected]> Tue, 27 Sep 2022 11:07:52 -0400
| Newsgroups | gmane.comp.lang.haskell.libraries |
|---|---|
| Message-ID | <CAHYVw0z8V2qab2S_aycQjeCMqm-xvKMJY8fGrssnBxHUA5xXrg@mail.gmail.com> |
--===============8577155662275946398== Content-Type: multipart/alternative; boundary="00000000000019e3a905e9aa0386" --00000000000019e3a905e9aa0386 Content-Type: text/plain; charset="UTF-8" Hey Isaac, thats certainly an interesting approach, it seems like that solves it by reframing the question as "can you implement a loop/trampoline in the monad". It would be even cooler to have an approach that does proper tail calls i think .. On Mon, Sep 26, 2022 at 8:15 PM Isaac Elliott <[email protected]> wrote: > > https://pursuit.purescript.org/packages/purescript-tailrec/6.1.0/docs/Control.Monad.Rec.Class > seems like a good starting point > > On Tue, 27 Sept 2022, 6:39 am Carter Schonwald, < > [email protected]> wrote: > >> Hello everyone! >> a recent conversation I has having led to an interesting question: is >> there a good interface or something for Monads which guarantee tail calls >> are tail calls? (ideally via a stronger api assumption for tail position >> computations in a monad rather than "trustme" style api contracts) >> >> thx >> -Carter >> _______________________________________________ >> Libraries mailing list >> [email protected] >> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries >> > --00000000000019e3a905e9aa0386 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div>Hey Isaac,</div><div>thats certainly an interesting a= pproach, it seems like that solves it by reframing the question as "ca= n you implement a loop/trampoline in the monad". It would be even cool= er to have an approach that does proper tail calls i think .. <br></div><di= v><br></div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"= gmail_attr">On Mon, Sep 26, 2022 at 8:15 PM Isaac Elliott <<a href=3D"ma= ilto:[email protected]">[email protected]</a>> wrote:<br></div><= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"auto"><a href= =3D"https://pursuit.purescript.org/packages/purescript-tailrec/6.1.0/docs/C= ontrol.Monad.Rec.Class" target=3D"_blank">https://pursuit.purescript.org/pa= ckages/purescript-tailrec/6.1.0/docs/Control.Monad.Rec.Class</a> seems like= a good starting point</div><br><div class=3D"gmail_quote"><div dir=3D"ltr"= class=3D"gmail_attr">On Tue, 27 Sept 2022, 6:39 am Carter Schonwald, <<= a href=3D"mailto:[email protected]" target=3D"_blank">carter.schon= [email protected]</a>> wrote:<br></div><blockquote class=3D"gmail_quote" st= yle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padd= ing-left:1ex"><div dir=3D"ltr">Hello everyone!<div>a recent conversation I = has having led to an interesting question: is there a good interface or som= ething for Monads which guarantee tail calls are tail calls? (ideally via a= stronger api assumption for tail position computations in a monad rather t= han "trustme" style api contracts)</div><div><br></div><div>thx= =C2=A0</div><div>-Carter</div></div> _______________________________________________<br> Libraries mailing list<br> <a href=3D"mailto:[email protected]" rel=3D"noreferrer" target=3D"_blan= k">[email protected]</a><br> <a href=3D"http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel= =3D"noreferrer noreferrer" target=3D"_blank">http://mail.haskell.org/cgi-bi= n/mailman/listinfo/libraries</a><br> </blockquote></div> </blockquote></div> --00000000000019e3a905e9aa0386-- --===============8577155662275946398== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KTGlicmFyaWVz IG1haWxpbmcgbGlzdApMaWJyYXJpZXNAaGFza2VsbC5vcmcKaHR0cDovL21haWwuaGFza2VsbC5v cmcvY2dpLWJpbi9tYWlsbWFuL2xpc3RpbmZvL2xpYnJhcmllcwo= --===============8577155662275946398==--