<div dir="ltr"><div dir="ltr">On Sun, Jan 13, 2019 at 4:00 PM Javran Cheng <<a href="mailto:javran.c@gmail.com">javran.c@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Cafe,<div><br></div><div>I'm wondering why Data.Void does not have a Monoid instance, or, what would be the problem if we do "mempty = absurd mempty"?</div></div></blockquote><div><br></div><div>This diverges, does it not?</div><div><br></div><div>A monoid has an identity element, and void does not. </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div><div>Long story: I was using a monad with some transformers, then I realize I can collapse State and Reader into RWST with Void being Writer output.</div><div>(well, I could have just used Unit but I wanna give Void a try...) I know beforehand that Void is Semigroup but is a bit surprise it doesn't have Monoid instance.</div></div></blockquote><div><br></div><div>How would you write return with void as the writer?</div><div><br></div><div>You can accomplish what you want with the free monoid over Void - i.e. [Void], which is isomorphic to unit. So unit seems like the right choice.</div><div><br></div><div>--Will</div></div></div>